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

nickserv.h File Reference

NickServ Header. More...

#include "queue.h"
#include "memoserv.h"
#include "string.h"
#include "struct.h"

Go to the source code of this file.

Defines

#define NISOPER   0x0001
 Is client +o ?

#define NISAWAY   0x0002
 Is client /AWAY ?

#define NISHELPOP   0x0004
 Is client +h ?

#define NISONLINE   0x0008
 Is client online? (huh?).

#define NISAHURT   0x0010
 Is client ahurt?

#define NOISMASK   0x0020
 Is client +m ?

#define NCNICK   0x1000
 CNICK sent?

#define NKILL   0x00001
 Enforcement.

#define NVACATION   0x00002
 Vacation */.

#define NHOLD   0x00004
 Held nickname for SN purposes */.

#define NIDENT   0x00008
 Require identification */.

#define NTERSE   0x00010
 Terse mode */.

#define NOADDOP   0x00040
 User not allowing addition to op lists.

#define NEMAIL   0x00080
 Show email.

#define NBANISH   0x00100
 Banished.

#define NGRPOP   0x00200
 Old grpop flag.

#define NBYPASS   0x00400
 Bypass AHURT.

#define NUSEDPW   0x00800
 Has ever identified.

#define NDBISMASK   0x01000
 +m option in nick db

#define NMARK   0x02000
 MARKED nick.

#define NDOEDIT   0x04000
 Not used anymore ATM, see /OS OVERRIDE.

#define NOSENDPASS   0x08000
 User doesn't want password recovery.

#define NACTIVE   0x10000
 User e-mail has been verified.

#define NDEACC   0x20000
 E-mail needs to be re-verified.

#define NFORCEXFER   0x40000
 by an oper

#define NENCRYPT   0x80000
 Password encrypted.

#define NAHURT   0x100000
 ???

#define OROOT   0x000001
#define OREMROOT   0x000002
#define OADMIN   0x000004
#define OSERVOP   0x000008
#define OOPER   0x000010
#define ORAKILL   0x000020
#define OAKILL   0x000040
#define OINFOPOST   0x000080
#define OSETOP   0x000100
#define OSETFLAG   0x000200
#define ONBANDEL   0x000400
#define OCBANDEL   0x000800
#define OIGNORE   0x001000
#define OGRP   0x002000
#define ORAW   0x004000
#define OJUPE   0x008000
#define OLIST   0x010000
#define OCLONE   0x020000
#define OPROT   0x080000
#define OACC   0x100000
#define OHELPOP   0x200000
#define ODMOD   0x400000
#define OAHURT   0x800000
#define OVERRIDE   OACC
#define OPFLAG_DEFAULT   (OOPER|ORAKILL|OINFOPOST|OACC)
 Default set of opflags that opers get.

#define OPFLAG_ADMIN
 default flags assigned with A

#define OPFLAG_PLUS   ((~0) & ~(OPFLAG_MINUS))
 All positive flags.

#define OPFLAG_MINUS   (0)
 All Negative/restrictive flags.

#define OPFLAG_ROOTSET
 Root-controlled flags.

#define OPFLAG_ROOT   (OPFLAG_PLUS|OROOT)
 Flags granted to root.


Functions

void addGhost (char *)
 Add a NickServ enforcer.

void delGhost (char *)
 Remove a NickServ enforcer.

void delTimedGhost (char *)
 Handle expiration of a NickServ ghost timer by removing the enforcer.

void setIdentify (UserList *, RegNickList *)
 Identifies an online user to a registered nickname.

void clearIdentify (UserList *)
 Clears any identify by an online user.

int isIdentified (UserList *, RegNickList *)
 Reports TRUE or FALSE indicating whether or not the specified user is identified to the specified nickname.

int isRecognized (UserList *, RegNickList *)
 Reports TRUE or FALSE indicating whether or not the specified user is recognized by access list (ACC 2) for the specified nickname.

int isOper (UserList *)
int isRoot (UserList *)
int issRoot (UserList *)
int isGRPop (UserList *)
int opFlagged (UserList *, flag_t)
flag_t getOpFlags (UserList *)
 Returns the effective flags of an online user.

int canAkill (UserList *)
int isServop (UserList *)
int checkAccess (char *, char *, RegNickList *)
 Used to test whether the specified user@hostname can be matched against an entry in an access list.

int isGhost (char *)
int addFlood (UserList *, int)
 Services Flood Protection -- addFlood adds the specified amount to a user's flood level, assuming this was added within tens econds of the last addition otherwise, simply makes floodlevel equal to whatever is sent. This function also updates lastmsg.

int addNReg (char *)
int addAccItem (RegNickList *, char *)
 Handles the work of placing an access item in a registered nickname's access list.

int delAccItem (RegNickList *, char *, char *)
 Handles the work of removing an access item from a registered nickname's access list.

void addNewUser (char **, int)
 Handles a server NICK message by adding a new user connection.

void remUser (char *, int ignoreDesync)
 Handles the QUIT server message, it removes a user from the nickname list and destroys the allocated memory area.

void sendToNickServ (UserList *, char **, int)
 Message handler for NickServ.

void setMode (char *, char *)
 Changes the modes of an online user.

void changeNick (char *, char *, char *)
 Handles a NICK command, allowing nicknames to change.

void nDesynch (char *, char *)
 Handle user desyncs.

void addNick (UserList *)
 Adds the online user item to the user hash tables and user list.

void addRegNick (RegNickList *)
 Adds the registered nick item to the nickname hash tables and user list.

void delNick (UserList *)
 Removes the online user item from the user hash tables and user list. When this function returns, 'killme' is no longer a valid pointer.

void delRegNick (RegNickList *)
 Removes the registered nick item from the nickname hash tables and nick list. When this function returns, 'killme' is no longer a valid pointer.

void setFlags (char *, int, char)
 Sets online flags of an online user structure.

void addAccessMask (char *, UserList *)
 Handle the ACCESS ADD command.

void delAccessMask (char *, UserList *)
 Handle the ACCESS DEL command.

void delNReg (char *)
void initNickData (RegNickList *)
void syncNickData (time_t)
 Saves the NickServ database.

UserListgetNickData (char *)
 Searches the user hash table for information about the specified online user by nickname. Returns a pointer to the online user item if found, otherwise returns NULL.

RegNickList * getRegNickData (const char *)
 Searches the regnick hash table for information about the specified registered nick data by nickname.

void addOpData (RegNickList *)
 Adds a user with opflags to the index.

void delOpData (RegNickList *)
 Removes and frees a user's index item from the oper index.

char * regnick_ugethost (UserList *, RegNickList *, int sM=1)


Detailed Description

NickServ Header.

Defines the various nickname flags, oper flags, and declares some nickname-related functions used throughout services.

Author:
Chip Norkus

Max Byrd

Greg Poma

James Hess

Date:
1996-2001
Id
nickserv.h,v 1.1.1.1 2003/07/04 02:55:33 Mysid Exp
*

Definition in file nickserv.h.


Define Documentation

#define NFORCEXFER   0x40000
 

by an oper

Nick is subject to forced transfer

Definition at line 87 of file nickserv.h.

Referenced by IpcType::alterRegNickMessage(), IpcType::authObjMessage(), and isIdentified().

#define OACC   0x100000
 

override user restrictions

Definition at line 112 of file nickserv.h.

Referenced by getOpFlags(), and opFlagged().

#define OADMIN   0x000004
 

is admin

Definition at line 95 of file nickserv.h.

#define OAHURT   0x800000
 

access to AutoHurt commands

Definition at line 115 of file nickserv.h.

#define OAKILL   0x000040
 

full akill priv

Definition at line 99 of file nickserv.h.

Referenced by canAkill(), os_akill(), readConf(), removeAkill(), and removeAkillType().

#define OCBANDEL   0x000800
 

can banish/del chans

Definition at line 104 of file nickserv.h.

Referenced by readConf().

#define OCLONE   0x020000
 

can edit clonerules

Definition at line 110 of file nickserv.h.

Referenced by readConf().

#define ODMOD   0x400000
 

direct modification

Definition at line 114 of file nickserv.h.

Referenced by do_chanop_add().

#define OGRP   0x002000
 

can getrealpass

Definition at line 106 of file nickserv.h.

Referenced by cs_set_memolvl(), and isGRPop().

#define OHELPOP   0x200000
 

user is a helpop

Definition at line 113 of file nickserv.h.

#define OIGNORE   0x001000
 

can set services ignores

Definition at line 105 of file nickserv.h.

Referenced by readConf().

#define OINFOPOST   0x000080
 

high-priority info post

Definition at line 100 of file nickserv.h.

Referenced by is_postnews().

#define OJUPE   0x008000
 

can jupe

Definition at line 108 of file nickserv.h.

#define OLIST   0x010000
 

can cs/ns list & cs whois

Definition at line 109 of file nickserv.h.

Referenced by readConf().

#define ONBANDEL   0x000400
 

can banish/del nicks

Definition at line 103 of file nickserv.h.

Referenced by readConf().

#define OOPER   0x000010
 

basic oper privs

Definition at line 97 of file nickserv.h.

Referenced by getOpFlags(), is_listnews(), is_sendinfo(), newsNag(), and opFlagged().

#define OPFLAG_ADMIN
 

Value:

default flags assigned with A

Definition at line 122 of file nickserv.h.

#define OPFLAG_ROOTSET
 

Value:

Root-controlled flags.

Definition at line 131 of file nickserv.h.

#define OPROT   0x080000
 

protect from normal setop

Definition at line 111 of file nickserv.h.

#define ORAKILL   0x000020
 

restricted akill priv

Definition at line 98 of file nickserv.h.

Referenced by os_akill(), and readConf().

#define ORAW   0x004000
 

can use raw

Definition at line 107 of file nickserv.h.

#define OREMROOT   0x000002
 

A secure flag

Definition at line 94 of file nickserv.h.

Referenced by readConf().

#define OROOT   0x000001
 

Services Root DONT CHANGE

Definition at line 93 of file nickserv.h.

Referenced by addOpData(), getOpFlags(), is_postnews(), isRoot(), isServop(), opFlagged(), parseLine(), readConf(), readNickData(), and saveNickData().

#define OSERVOP   0x000008
 

is servop (deprecated)

Definition at line 96 of file nickserv.h.

Referenced by is_postnews(), isServop(), readConf(), readNickData(), and saveNickData().

#define OSETFLAG   0x000200
 

can use setflag

Definition at line 102 of file nickserv.h.

Referenced by readConf().

#define OSETOP   0x000100
 

can use setop/add/del

Definition at line 101 of file nickserv.h.

#define OVERRIDE   OACC
 

symbolic alias

Definition at line 116 of file nickserv.h.

Referenced by do_chanop_add(), getMiscChanOp(), and isFounder().


Function Documentation

void addAccessMask char *  mask,
UserList nick
 

Handle the ACCESS ADD command.

Parameters:
mask Pointer to host address pattern to add to access list
nick List of online user requesting the add
Precondition:
Mask points to a valid NUL-terminated character array that consists of a valid NickServ access mask of the form user@host. Nick points to the record of an online user that is also a registered nick. nick->reg points to a valid registered nickname record.
Postcondition:
The specified mask is added to the online user's registered nickname.

Definition at line 1472 of file nickserv.c.

References AccessLimit, addAccItem(), isIdentified(), mask(), _userlist::nick, NickServ, _userlist::reg, and sSend().

Referenced by ns_addmask().

int addAccItem RegNickList *  nick,
char *  mask
 

Handles the work of placing an access item in a registered nickname's access list.

Parameters:
nick Registered nickname item to add an access list item to
mask Mask string to add a copy of
Precondition:
Nick is a pointer to a registered nickname record, and mask is a pointer to a NUL-terminated character array that is a valid user@host NickServ access mask.

Definition at line 2207 of file nickserv.c.

Referenced by addAccessMask(), and readNickData().

int addFlood UserList tmp,
int  addtoflood
 

Services Flood Protection -- addFlood adds the specified amount to a user's flood level, assuming this was added within tens econds of the last addition otherwise, simply makes floodlevel equal to whatever is sent. This function also updates lastmsg.

Parameters:
tmp Pointer to online user item
addtoflood Number of flood points the command is worth
Precondition:
Tmp is a pointer to a valid online user record, and addtoflood is an integer between of 0 and 100.
Postcondition:
Services flood checks have been performed. If a user floods excessively, they might have been killed. If a user has been killed then this procedure will have returned a non-zero value and their online user record can no longer be treated as valid without performing a nick lookup from the online users table based on a 'safe' copy of the nick string.
Warning:
If a user structure is killed, then so are all strings on the structure, example: 'char *from = nick->nick;' if the 'nick' structure is killed, then from is no longer valid. For most procedures, processing should return up back to a command interpreter once addFlood(nick, ...) returns a non-zero value.

Definition at line 2053 of file nickserv.c.

Referenced by BadPwChan(), BadPwNick(), gs_roll(), and parseLine().

void addGhost char *  ghost  ) 
 

Add a NickServ enforcer.

Parameters:
ghost What nickname to place a services enforcer on
Precondition:
Ghost is a pointer to a valid NUL-terminated character array containing an IRC nickname consisting of alphanumeric characters and a length between 1 and (NICKLEN - 1) characters. There is not a record in the online user table with a nickname the same as that specified.
Postcondition:
A services enforcer is signed on with the specified nickname.
Warning:
The enforcer is not scheduled for removal to do so, a timer must be set to call the delTimedGhost procedure with the ghost nickname as a parameter.

Definition at line 1811 of file nickserv.c.

References addUser(), firstGhost, ghost_struct::ghost, GhostList, lastGhost, ghost_struct::next, oalloc(), ghost_struct::previous, strncpyzt, totalghosts, and totalusers.

Referenced by addNewUser(), changeNick(), checkAkillAllUsers(), and parseLine().

void addNewUser char **  args,
int  numargs
 

Handles a server NICK message by adding a new user connection.

Parameters:
args Argument vector for received NICK server message
numargs Argument count for received NICK numargs
Precondition:
Args is non-NULL pointer to a valid char** array from a NICK message. Numargs is the number of elements in the outer array, and all inner elements are NUL-terminated
Postcondition:
A user structure from the supplied NICK message created and added to the services online user list.

Definition at line 417 of file nickserv.c.

References addClone(), addGhost(), addNick(), annoyNickThief(), applyAkill(), _userlist::caccess, checkAccess(), corelog, CTime, delTimedGhost(), dlogEntry(), freeUserListRec(), getNickData(), getRegNickData(), service_struct::host, _userlist::host, _userlist::idnum, InfoServ, isGhost(), logDump(), mostusers, service_struct::name, NBANISH, NDBISMASK, NDOEDIT, _userlist::nick, NickSeeUser(), NickServ, NISAHURT, NOISMASK, oalloc(), _userlist::oflags, OperServ, parse_str(), PutReply, _userlist::reg, RegId::SetNext(), SetUserNickHostReal(), sSend(), timer(), _userlist::timestamp, top_user_idnum(), totalusers, _userlist::user, and VERSION_NUM.

Referenced by parseLine().

void addNick UserList newnick  ) 
 

Adds the online user item to the user hash tables and user list.

Precondition:
Newnick is initialized to point to an allocated structure of type newnick.
Postcondition:
The structure newnick is added to the online users hash table.
Parameters:
nick User to add to the list

Definition at line 1129 of file nickserv.c.

References dlogEntry(), getHashKey(), LIST_ENTRY_INIT, LIST_INSERT_HEAD, _userlist::nick, totalusers, and UserHash.

Referenced by addNewUser(), and changeNick().

void addOpData RegNickList *  nick  ) 
 

Adds a user with opflags to the index.

Parameters:
nick Pointer to registered nickname item to add

Definition at line 2335 of file nickserv.c.

References firstOper, operlist_struct::next, oalloc(), OROOT, and operlist_struct::who.

Referenced by readConf(), and readNickData().

void addRegNick RegNickList *  newnick  ) 
 

Adds the registered nick item to the nickname hash tables and user list.

Precondition:
Newnick is initialized to point to a freshly-allocated nickname structure, it is not a null pointer, and no registered nick structure listed has the same nickname.
Postcondition:
The registered nick structure is added onto the hash table of registered nicknames.
Parameters:
nick Pointer to registered nickname item

Definition at line 1154 of file nickserv.c.

References assert, corelog, freeRegNickListRec(), RegId::getHashKey(), getHashKey(), getRegNickData(), RegNickIdMap::id, LIST_ENTRY_INIT, LIST_FIRST, LIST_INSERT_AFTER, LIST_INSERT_BEFORE, LIST_INSERT_HEAD, LIST_NEXT, logDump(), RegNickIdMap::nick, oalloc(), RegNickHash, and RegNickIdHash.

Referenced by IpcType::makeMessage(), and readNickData().

int canAkill UserList nick  ) 
 

Returns:
FALSE if nick is a null pointer or has no access to the AKILL command as a result of the OAKILL opflag, specifically.
Precondition:
Nick is initialized to point to a valid online user or is a null pointer.
Parameters:
nick Nickname to check for akill access

Definition at line 1067 of file nickserv.c.

References isIdentified(), isOper(), OAKILL, and _userlist::reg.

void changeNick char *  from,
char *  to,
char *  ts
 

Handles a NICK command, allowing nicknames to change.

Parameters:
from Nickname of user to be changed
to Target nickname
ts Timestamp string of nickname change (if any)
Precondition:
From, to, and ts are all non-null pointers to 0-terminated character arrays.
Postcondition:
Nickname of online user is internally recorded as changed to 'from' at time 'ts'. The original nick structure is deleted. Some members are copied over, but many members are reset to initial values.
Called when someone uses the NICK command to change their nicks obviously...changed from, to, and it hands off the timestamp so that last seen time can be updated

Side Effects:
The entire online user structure is destroyed and re-created. Fields are copied manually, so any online user member that needs to follow the user across nick changes has to be special-cased here.

Definition at line 563 of file nickserv.c.

References addGhost(), addNick(), annoyNickThief(), _userlist::caccess, changeNickOnAllChans(), checkAccess(), clearIdentify(), CTime, delNick(), delTimedGhost(), dlogEntry(), _userlist::floodlevel, _userlist::gecos, getNickData(), getRegNickData(), service_struct::host, _userlist::host, _userlist::id, _identifydata::idnum, _userlist::idnum, isAKilled(), isGhost(), isIdentified(), killide(), myname, service_struct::name, NBANISH, NCNICK, nDesynch(), _identifydata::nick, _userlist::nick, NickSeeUser(), NickServ, oalloc(), _userlist::oflags, _userlist::reg, remUser(), RegId::SetNext(), SetUserNickHostReal(), sSend(), timer(), _identifydata::timestamp, _userlist::timestamp, top_user_idnum(), and _userlist::user.

Referenced by parseLine().

int checkAccess char *  user,
char *  host,
RegNickList *  nick
 

Used to test whether the specified user@hostname can be matched against an entry in an access list.

Precondition:
Both user and host point to valid NUL-terminated character arrays containing respectively an IRC username and IRC hostname of an online or recent user. Nick points to a valid registered nickname record.
Parameters:
user Pointer to the username to match
host Pointer to the hostname to match
nick Registered nickname to search the access list of

Definition at line 1343 of file nickserv.c.

References LIST_FIRST, LIST_NEXT, _naccesslist::mask, and match().

Referenced by addNewUser(), changeNick(), getMiscChanOp(), and isRecognized().

void clearIdentify UserList user  ) 
 

Clears any identify by an online user.

Parameters:
user Pointer to the online user who is to be affected
Precondition:
User points to a valid, non-null online user object.
Postcondition:
User will no longer be identified to any remote nickname.

Definition at line 819 of file nickserv.c.

References _userlist::id, _identifydata::idnum, _identifydata::nick, and _identifydata::timestamp.

Referenced by changeNick(), and delNick().

void delAccessMask char *  mask,
UserList nick
 

Handle the ACCESS DEL command.

Parameters:
mask Pointer to host address pattern to delete from the access list
nick List of online user requesting the delete
Precondition:
Mask points to a valid NUL-terminated character array. Nick points to the record of an online user that is also a registered nick with a nick->reg member pointing to that record.
Postcondition:
The specified mask is removed from the online user's registered nickname if it could be found. If the mask specified is '-', then the registered nickname's access list is wiped clean.

Definition at line 1519 of file nickserv.c.

References delAccItem(), isIdentified(), LIST_FIRST, LIST_NEXT, _naccesslist::mask, mask(), _userlist::nick, NickServ, _userlist::reg, and sSend().

int delAccItem RegNickList *  nick,
char *  mask,
char *  deletedmask
 

Handles the work of removing an access item from a registered nickname's access list.

Parameters:
nick Registered nickname item to delete an access list item from
mask Mask to remove
Precondition:
Nick pointers to a valid registered nickname record, mask points to a valid NUL-terminated character array, and deletedmask points to a character memory area of at least size 70 bytes.
Postcondition:
If mask is found in the access list of nick, then that mask is removed. The string of the deleted mask is copied into the area pointed by deletedmask.
Returns:
1 If a mask was deleted, 0 if no mask was removed.

Definition at line 2255 of file nickserv.c.

Referenced by delAccessMask().

void delGhost char *  ghost  ) 
 

Remove a NickServ enforcer.

Parameters:
ghost Nickname of the enforcer to remove
Precondition:
Ghost is a pointer to a valid NUL-terminated character array bearing a legal IRC nickname.
Postcondition:
If the nickname was that of an online services enforcer, then services has removed the enforcer and the information stored about the enforcer.

Definition at line 1859 of file nickserv.c.

References firstGhost, getGhost(), GhostList, lastGhost, ghost_struct::next, ghost_struct::previous, sSend(), totalghosts, and totalusers.

Referenced by parseLine().

void delNick UserList killme  ) 
 

Removes the online user item from the user hash tables and user list. When this function returns, 'killme' is no longer a valid pointer.

Precondition:
Killme points to a valid, non-null online user object that is found in the online user list (or table).
Postcondition:
The online user nick object is removed from the online user table and freed from memory.
Parameters:
nick Pointer to an online user item to delete

Definition at line 1222 of file nickserv.c.

References clearIdentify(), flush_ad(), freeUserListRec(), LIST_REMOVE, and totalusers.

Referenced by changeNick(), and remUser().

void delOpData RegNickList *  nick  ) 
 

Removes and frees a user's index item from the oper index.

Parameters:
nick Pointer to registered nickname item to remove

Definition at line 2362 of file nickserv.c.

References firstOper, operlist_struct::next, and operlist_struct::who.

Referenced by delRegNick(), and readConf().

void delRegNick RegNickList *  killme  ) 
 

Removes the registered nick item from the nickname hash tables and nick list. When this function returns, 'killme' is no longer a valid pointer.

Precondition:
Killme points to a valid, non-null registered nickname object that is found in the nick table.
Postcondition:
The registered nick object is removed from the nick table and freed from memory.
Parameters:
nick Registered nick object to delete

Definition at line 1243 of file nickserv.c.

References delMemo(), delOpData(), freeRegNickListRec(), LIST_FIRST, LIST_NEXT, LIST_REMOVE, and _memolist::realto.

void delTimedGhost char *  ghost  ) 
 

Handle expiration of a NickServ ghost timer by removing the enforcer.

Parameters:
ghost Nickname of timed ghost
Side Effects:
the supplied ghost pointer value is freed
Precondition:
Ghost is a pointer to a valid NUL-terminated character array bearing a legal IRC nickname.
Postcondition:
delGhost() was called with the supplied value for 'ghost' to remove an enforcer if it was present, AND the memory pointed to by 'ghost' was freed.

Definition at line 1898 of file nickserv.c.

UserList* getNickData char *  nick  ) 
 

Searches the user hash table for information about the specified online user by nickname. Returns a pointer to the online user item if found, otherwise returns NULL.

Precondition:
Nick points to a valid NUL-terminated character array.
Parameters:
nick Nickname of the user to find
Returns:
A null pointer if no online user structure found in the table has the specified nickname, else a pointer to one of the online user structures found.

Definition at line 1288 of file nickserv.c.

References getHashKey(), LIST_FIRST, LIST_NEXT, _userlist::nick, and UserHash.

Referenced by addNewUser(), changeNick(), getMiscChanOp(), guest_cnick(), isFounder(), killide(), make_clone(), IpcType::makeMessage(), nDesynch(), parseLine(), IpcType::queryRegNickMessage(), regnick_ugethost(), removeAkill(), removeAkillType(), remUser(), sendToNickServ(), setChanMode(), setFlags(), and setMode().

flag_t getOpFlags UserList nick  ) 
 

Returns the effective flags of an online user.

Parameters:
nick Pointer to online user item to extract flags from
Precondition:
Nick points to a valid online user object or is a null pointer.
A bitmask is returned with all flags that the user has access to set. The exception being that the '+a' flag is only set if /OPERSERV OVERRIDE is being used. If a null pointer is provided, the return value is zero.

Warning:
Presence of the +a flag cannot be tested with this function. OACC/OVERRIDE will return true only if /os override is in use.

Definition at line 946 of file nickserv.c.

References isIdentified(), isOper(), OACC, OOPER, OPFLAG_PLUS, OROOT, _userlist::reg, and userOverriding().

Referenced by sendToChanServ(), sendToGameServ(), sendToInfoServ(), sendToMemoServ(), sendToNickServ(), and sendToOperServ().

RegNickList* getRegNickData const char *  nick  ) 
 

Searches the regnick hash table for information about the specified registered nick data by nickname.

Returns:
A pointer to the registered nick record if one could be found. Else a null pointer.
Precondition:
Nick points to a valid NUL-terminated character array.
Parameters:
nick Nickname of the registered nick item to find

Definition at line 1312 of file nickserv.c.

References getHashKey(), LIST_FIRST, LIST_NEXT, and RegNickHash.

Referenced by addNewUser(), addRegNick(), IpcType::alterObjMessage(), IpcType::authObjMessage(), changeNick(), getChanOpData(), getMiscChanOp(), killide(), make_clone(), IpcType::makeMessage(), ms_DelMemoBlock(), IpcType::queryObjMessage(), readChanData(), readConf(), readMemoData(), readNickData(), and setMode().

int isGhost char *  ghost  ) 
 

Precondition:
Ghost is a pointer to a valid NUL-terminated character array whose contents are a valid IRC nickname string.
Returns:
FALSE if the specified nickname is not a NickServ enforcer. Else a non-zero value.
Parameters:
ghost Nickname to check

Definition at line 1926 of file nickserv.c.

Referenced by addNewUser(), changeNick(), and parseLine().

int isGRPop UserList nick  ) 
 

Returns:
FALSE if the specified online user is a null pointer or has no access to the NickServ getrealpass command; else a value other than FALSE is returned.
Precondition:
Nick points to a valid online user object or is a null pointer.
Parameters:
nick Pointer to an online user item

Definition at line 1025 of file nickserv.c.

References isIdentified(), isOper(), OGRP, and _userlist::reg.

int isIdentified UserList user,
RegNickList *  nick
 

Reports TRUE or FALSE indicating whether or not the specified user is identified to the specified nickname.

Parameters:
user Pointer to online user to check for identification from
nick Pointer to registered nickname to check for identification to
Precondition:
User points to a valid online user object, nick points to a valid registered nickname object.
Returns:
FALSE indicates no identification, any other value indicates that the user is identified.

Definition at line 842 of file nickserv.c.

References _userlist::caccess, _userlist::id, _identifydata::idnum, NFORCEXFER, _identifydata::nick, NVACATION, _userlist::reg, _userlist::timestamp, and _identifydata::timestamp.

Referenced by addAccessMask(), canAkill(), changeNick(), delAccessMask(), getMiscChanOp(), getOpFlags(), isGRPop(), isHelpop(), isRecognized(), isRoot(), isServop(), killide(), opFlagged(), remUser(), and setMode().

int isOper UserList nick  ) 
 

Parameters:
nick Pointer to an online user item if the specified online user is invalid or not globally opered. Any other value indicates the user is an oper.
Precondition:
Nick is a NULL pointer or a valid online user object.

Definition at line 887 of file nickserv.c.

References NISOPER, and _userlist::oflags.

Referenced by addUserToChan(), canAkill(), getMiscChanOp(), getOpFlags(), is_listnews(), is_sendinfo(), isGRPop(), isRoot(), isServop(), newsNag(), opFlagged(), parseLine(), and sendToOperServ().

int isRecognized UserList user,
RegNickList *  nick
 

Reports TRUE or FALSE indicating whether or not the specified user is recognized by access list (ACC 2) for the specified nickname.

Parameters:
user Pointer to online user to check for recognition from
nick Pointer to registered nickname to check for recognition to
Precondition:
User points to a valid online user object. Nick points to a valid registered nickname object.
Returns:
FALSE too indicate no recognition, any other value to indicate the user is recognized as being on the access list of the target nick.

Definition at line 870 of file nickserv.c.

References _userlist::caccess, checkAccess(), _userlist::host, isIdentified(), NVACATION, _userlist::reg, and _userlist::user.

Referenced by getMiscChanOp(), isFounder(), regnick_ugethost(), and setMode().

int isRoot UserList nick  ) 
 

Returns:
FALSE if nick is a null pointer or the user pointed to does not have services root privileges
Precondition:
Nick points to a valid online user object or is a null pointer.
Parameters:
nick Pointer to an online user item

Definition at line 983 of file nickserv.c.

References isIdentified(), isOper(), OROOT, and _userlist::reg.

Referenced by gs_roll(), and is_save().

int isServop UserList nick  ) 
 

Returns:
FALSE if the specified nick is a null pointer or not currently a Services Operator, or IRCop with services operator access.
Precondition:
Nick points to a valid online user object or is a null pointer.
Parameters:
nick Pointer to an online user item

Definition at line 1003 of file nickserv.c.

References isIdentified(), isOper(), OROOT, OSERVOP, and _userlist::reg.

void nDesynch char *  nick,
char *  type
 

Handle user desyncs.

Parameters:
nick the nickname (in char * form)
type Type of desync / What caused the desync? (in char * form)
Precondition:
Nick and type are non-null pointers to 0-terminated char arrays, 'nick' is the nickname of a client services doesnt see as online.
Postcondition:
Client is killed off the network, desync message is sent if appropriate. If someone desynched does something and we don't see that they exist, yell about it, and kill them to resync

Definition at line 252 of file nickserv.c.

References dlogEntry(), getNickData(), myname, NickServ, and sSend().

Referenced by changeNick(), parseLine(), remUser(), sendToNickServ(), setFlags(), and setMode().

int opFlagged UserList nick,
flag_t  flag
 

Returns:
FALSE if the online user is a null pointer or does not have all operator flags specified; any other value may be returned if the oper has all flags specified.
Parameters:
nick Pointer to online user item to check
flag Bitmask with flags specified to check set and all others clear
Precondition:
Nick points to a valid online user object or is a null pointer. Flag consists of an operator flag value as found in operserv.h or a sequence of such flags (ex: OOPER | OSERVOP)
Warning:
Presence of the +a flag cannot be tested with this function. OACC/OVERRIDE will return true only if /os override is in use.

Definition at line 912 of file nickserv.c.

References FALSE, isIdentified(), isOper(), OACC, OOPER, OPFLAG_ROOT, OROOT, _userlist::reg, and userOverriding().

Referenced by cs_set_memolvl(), do_chanop_add(), getMiscChanOp(), is_postnews(), isFounder(), removeAkill(), and removeAkillType().

char* regnick_ugethost UserList user,
RegNickList *  target,
int  sM
 

Parameters:
user User requesting information
target Nick about whom host information is requested
Precondition:
User is a null pointer or valid online user record. Target is a null pointer or valid registered nickname record.
Returns:
The last seen host of the target as it should be shown to the user requesting that information.

Definition at line 1422 of file nickserv.c.

References genHostMask(), getNickData(), isRecognized(), NDBISMASK, NISOPER, NOISMASK, _userlist::oflags, and strncpyzt.

Referenced by do_chanop_list(), and GoodPwNick().

void remUser char *  nick,
int  ignoreDesync
 

Handles the QUIT server message, it removes a user from the nickname list and destroys the allocated memory area.

Precondition:
Nick is initialized to point to a NUL-terminated character array that contains the nickname know to be that of a valid online user structure.
Postcondition:
After a call to this function, nick is no longer in the online list, any pointer to that nickname's online user structure is now invalid, and services no longer considers the user to be on IRC.
Parameters:
nick Nickname of online user
ignoreDesync Non-zero value means to ignore desyncs

Definition at line 1095 of file nickserv.c.

References cleanMemos(), CTime, delClone(), delNick(), dlogEntry(), getNickData(), _userlist::host, isIdentified(), nDesynch(), _userlist::reg, remFromAllChans(), and _userlist::user.

Referenced by changeNick(), checkAkillAllUsers(), and parseLine().

void sendToNickServ UserList tmp,
char **  args,
int  numargs
 

Message handler for NickServ.

Precondition:
Tmp points to a valid online user record. Args points to a valid C-string vector with numargs outer indices, the sum of whose lengths is IRCBUF or less, and whose contents are the text of a valid IRC PRIVMSG command split along spaces and starting after the message target.
Postcondition:
If NickServ command requested of the user was valid, then it will have been executed.
Parameters:
tmp Pointer to online user initiating the msesage
args Args of the message, where args[0] is the command and the extra parameters follow
numargs Highest index in the args[] array passed plus 1. so args[numargs - 1] is the highest index that can be safely accessed.

Definition at line 1376 of file nickserv.c.

References CTime, getNickData(), getOpFlags(), nDesynch(), nextNsync, _userlist::nick, NickServ, nickserv_commands, RET_FAIL, RET_OK_DB, and sSend().

Referenced by parseLine().

void setFlags char *  nick,
int  flag,
char  change
 

Sets online flags of an online user structure.

Parameters:
nick Nickname of the user whom flags are to be changed on
flag Flag to be added or removed from the user
change Indicates whether to add or remove the flag
Precondition:
Nick is a pointer to a terminated character array and the nickname of an online user, flag is a valid online user flag as defined in nickserv.h, and 'change' has the value of the literal '+' or the literal '-'
Postcondition:
Specified online flag will be added or removed from the structure of the online user. If '+' is the value of change, then addition occurs, if '-' is the value of change, then removal of a bit occurs.

Definition at line 771 of file nickserv.c.

References dlogEntry(), getNickData(), nDesynch(), and _userlist::oflags.

Referenced by parseLine().

void setIdentify UserList user,
RegNickList *  nick
 

Identifies an online user to a registered nickname.

Parameters:
user Pointer to online user who is identifying
nick Pointer to registered nickname to be identified
Precondition:
Neither user nor nick are null pointers. User is a valid online user structure, and nick points to a valid online registered nick structure.
Postcondition:
Online user user will be marked as having identified to the nickname nick.

Definition at line 799 of file nickserv.c.

References CTime, _userlist::id, _identifydata::idnum, MAX, _identifydata::nick, _userlist::nick, oalloc(), _userlist::timestamp, and _identifydata::timestamp.

void setMode char *  nick,
char *  mode
 

Changes the modes of an online user.

Parameters:
nick Nickname of user whose modes are changing
mode Mode change to be applied to the user
Precondition:
Nick and mode are pointers to valid NUL-terminated character arrays, 'nick' is that of an online user object found in the user hash table, and 'mode' is a valid mode-change string.
Postcondition:
User structure is modified to take into account specified mode changes.
Handles a MODE message for a user. Of particular interest to services are the state of the 'o' and 'm' usermodes.

Definition at line 696 of file nickserv.c.

References dlogEntry(), getNickData(), getRegNickData(), isIdentified(), isRecognized(), NDBISMASK, nDesynch(), _userlist::nick, NISAHURT, NISHELPOP, NISOPER, NOISMASK, and _userlist::oflags.

Referenced by parseLine().

void syncNickData time_t  next  ) 
 

Saves the NickServ database.

Parameters:
next When the NickServ database should next be saved (UTC)

Definition at line 2292 of file nickserv.c.

References nextNsync.

Referenced by sync_cfg().


Generated at Sat Oct 25 20:56:12 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.