Anope IRC Services  Version 1.8
Data Structures | Macros | Functions | Variables
nickserv.c File Reference
#include "services.h"
#include "pseudo.h"
Include dependency graph for nickserv.c:

Go to the source code of this file.

Data Structures

struct  my_timeout
 

Macros

#define HASH(nick)   ((tolower((nick)[0])&31)<<5 | (tolower((nick)[1])&31))
 
#define TO_COLLIDE   0 /* Collide the user with this nick */
 
#define TO_RELEASE   1 /* Release a collided nick */
 
#define SAFE(x)
 
#define SAFE(x)
 

Functions

static void add_ns_timeout (NickAlias *na, int type, time_t delay)
 
void moduleAddNickServCmds (void)
 
void listnicks (int count_only, const char *nick)
 
void get_aliases_stats (long *nrec, long *memuse)
 
void get_core_stats (long *nrec, long *memuse)
 
void ns_init (void)
 
void nickserv (User *u, char *buf)
 
void load_old_ns_dbase (void)
 
void load_ns_req_db (void)
 
void load_ns_dbase (void)
 
void save_ns_dbase (void)
 
void save_ns_req_dbase (void)
 
void save_ns_rdb_dbase (void)
 
void save_ns_req_rdb_dbase (void)
 
int validate_user (User *u)
 
void cancel_user (User *u)
 
int nick_identified (User *u)
 
int nick_recognized (User *u)
 
int group_identified (User *u, NickCore *nc)
 
void expire_nicks ()
 
void expire_requests ()
 
NickRequestfindrequestnick (const char *nick)
 
NickAliasfindnick (const char *nick)
 
NickCorefindcore (const char *nick)
 
int is_on_access (User *u, NickCore *nc)
 
void alpha_insert_alias (NickAlias *na)
 
void insert_core (NickCore *nc)
 
void insert_requestnick (NickRequest *nr)
 
void change_core_display (NickCore *nc, char *newdisplay)
 
static int delcore (NickCore *nc)
 
int delnickrequest (NickRequest *nr)
 
int delnick (NickAlias *na)
 
void collide (NickAlias *na, int from_timeout)
 
void release (NickAlias *na, int from_timeout)
 
static void rem_ns_timeout (NickAlias *na, int type)
 
static void timeout_collide (Timeout *t)
 
static void timeout_release (Timeout *t)
 
void del_ns_timeout (NickAlias *na, int type)
 
void clean_ns_timeouts (NickAlias *na)
 
int should_mode_change (int16 status, int16 mode)
 
int do_setmodes (User *u)
 
void nsStartNickTracking (User *u)
 
void nsStopNickTracking (User *u)
 
int nsCheckNickTracking (User *u)
 

Variables

NickAliasnalists [1024]
 
NickCorenclists [1024]
 
NickRequestnrlists [1024]
 
unsigned int guestnum
 
static struct my_timeoutmy_timeouts
 

Macro Definition Documentation

#define HASH (   nick)    ((tolower((nick)[0])&31)<<5 | (tolower((nick)[1])&31))
#define SAFE (   x)
Value:
do { \
if ((x) < 0) { \
if (!forceload) \
fatal("Read error on %s", NickDBName); \
failed = 1; \
break; \
} \
} while (0)
E char * NickDBName
Definition: extern.h:332
E void E void E void fatal(const char *fmt,...) FORMAT(printf
E int forceload
Definition: extern.h:780

Definition at line 753 of file nickserv.c.

Referenced by load_ns_dbase(), load_ns_req_db(), load_old_ns_dbase(), save_ns_dbase(), and save_ns_req_dbase().

#define SAFE (   x)
Value:
do { \
if ((x) < 0) { \
log_perror("Write error on %s", NickDBName); \
if (time(NULL) - lastwarn > WarningTimeout) { \
anope_cmd_global(NULL, "Write error on %s: %s", NickDBName, \
strerror(errno)); \
lastwarn = time(NULL); \
} \
return; \
} \
} while (0)
E int WarningTimeout
Definition: extern.h:347
E char * NickDBName
Definition: extern.h:332
E void restore_db(dbFILE *f)
Definition: datafiles.c:318
E char * strerror(int errnum)
Definition: compat.c:123
static time_t lastwarn
Definition: datafiles.c:19
E void E void log_perror(const char *fmt,...) FORMAT(printf
E void anope_cmd_global(char *source, const char *fmt,...)
Definition: ircd.c:506

Definition at line 753 of file nickserv.c.

#define TO_COLLIDE   0 /* Collide the user with this nick */

Definition at line 28 of file nickserv.c.

Referenced by add_ns_timeout(), cancel_user(), collide(), timeout_collide(), and validate_user().

#define TO_RELEASE   1 /* Release a collided nick */

Definition at line 29 of file nickserv.c.

Referenced by add_ns_timeout(), cancel_user(), clean_ns_timeouts(), release(), and timeout_release().

Function Documentation

static void add_ns_timeout ( NickAlias na,
int  type,
time_t  delay 
)
static
void alpha_insert_alias ( NickAlias na)
void cancel_user ( User u)
void change_core_display ( NickCore nc,
char *  newdisplay 
)
void clean_ns_timeouts ( NickAlias na)
void collide ( NickAlias na,
int  from_timeout 
)
void del_ns_timeout ( NickAlias na,
int  type 
)
static int delcore ( NickCore nc)
static
int delnick ( NickAlias na)
int delnickrequest ( NickRequest nr)
int do_setmodes ( User u)

Definition at line 1940 of file nickserv.c.

References c, chan_set_correct_modes(), user_::chans, MOD_CONT, and user_::u_chanlist::next.

Referenced by do_identify(), and do_nickupdate().

void expire_nicks ( void  )
void expire_requests ( void  )
NickCore* findcore ( const char *  nick)
NickAlias* findnick ( const char *  nick)

Definition at line 1239 of file nickserv.c.

References alog(), debug, HASH, nickalias_::next, nickalias_::nick, and stricmp().

Referenced by listnicks(), and load_old_ns_dbase().

NickRequest* findrequestnick ( const char *  nick)
void get_aliases_stats ( long *  nrec,
long *  memuse 
)
void get_core_stats ( long *  nrec,
long *  memuse 
)
int group_identified ( User u,
NickCore nc 
)

Definition at line 1151 of file nickserv.c.

References user_::na, nickalias_::nc, and nick_identified().

Referenced by do_ghost(), do_recover(), and do_release().

void insert_core ( NickCore nc)
void insert_requestnick ( NickRequest nr)
int is_on_access ( User u,
NickCore nc 
)
void listnicks ( int  count_only,
const char *  nick 
)
void load_ns_dbase ( void  )
void load_ns_req_db ( void  )
void load_old_ns_dbase ( void  )
void moduleAddNickServCmds ( void  )

Definition at line 37 of file nickserv.c.

References modules_core_init(), NickServCoreModules, and NickServCoreNumber.

Referenced by ns_init().

int nick_identified ( User u)
int nick_recognized ( User u)
void nickserv ( User u,
char *  buf 
)

Definition at line 244 of file nickserv.c.

References anope_cmd_ctcp(), mod_run_cmd(), user_::nick, NICKSERV, notice_lang(), s_NickServ, skeleton, and stricmp().

Referenced by m_privmsg().

void ns_init ( void  )

Definition at line 232 of file nickserv.c.

References guestnum, and moduleAddNickServCmds().

Referenced by init_secondary().

int nsCheckNickTracking ( User u)

Boolean function to check if the user requesting a nick has the tracking signature of that core in its structure.

Parameters
uThe user whom to check tracking for

Definition at line 1998 of file nickserv.c.

References nickcore_::display, user_::na, nickalias_::nc, nickalias_::nick, user_::nickTrack, NS_VERBOTEN, and nickalias_::status.

Referenced by do_nick().

void nsStartNickTracking ( User u)

Start Nick tracking and store the nick core display under the user struct.

Parameters
uThe user to track nicks for

Definition at line 1962 of file nickserv.c.

References nickcore_::display, user_::na, nickalias_::nc, nick_identified(), user_::nickTrack, and sstrdup().

Referenced by anope_event_encap(), anope_event_metadata(), do_confirm(), do_group(), do_identify(), do_nick(), do_saset_display(), and do_set_display().

void nsStopNickTracking ( User u)

Stop Nick tracking and remove the nick core display under the user struct.

Parameters
uThe user to stop tracking for

Definition at line 1984 of file nickserv.c.

References user_::nickTrack.

Referenced by do_logout().

void release ( NickAlias na,
int  from_timeout 
)
static void rem_ns_timeout ( NickAlias na,
int  type 
)
static
void save_ns_dbase ( void  )
void save_ns_rdb_dbase ( void  )
void save_ns_req_dbase ( void  )
void save_ns_req_rdb_dbase ( void  )
int should_mode_change ( int16  status,
int16  mode 
)
static void timeout_collide ( Timeout t)
static
static void timeout_release ( Timeout t)
static

Definition at line 1780 of file nickserv.c.

References timeout_::data, my_timeout::na, release(), rem_ns_timeout(), and TO_RELEASE.

Referenced by add_ns_timeout().

int validate_user ( User u)

Variable Documentation

unsigned int guestnum

Definition at line 26 of file nickserv.c.

Referenced by ns_init().

struct my_timeout * my_timeouts
static
NickAlias* nalists[1024]

Definition at line 22 of file nickserv.c.

NickCore* nclists[1024]

Definition at line 23 of file nickserv.c.

NickRequest* nrlists[1024]

Definition at line 24 of file nickserv.c.