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

server.c File Reference

#include "services.h"
#include "nickserv.h"
#include "operserv.h"
#include "memoserv.h"
#include "chanserv.h"
#include "infoserv.h"
#include "gameserv.h"
#include "mass.h"
#include "log.h"

Go to the source code of this file.

Defines

#define MAX_IRC_LINE_LEN   512
 Maximum length of an IRC message.


Functions

void parseLine (char *)
int ConnectToServer (char *hostname, int portnum)
 Used at services startup to connect to its uplink.

void sSend (char *format,...)
 a printf-like function for sending data to the services uplink socket

void addUser (char *nick, char *user, char *host, char *name, char *mode)
void breakLine (char *tmpbuffer)
void sendInfoReply (UserList *nick)

Variables

char oldData [MAX_IRC_LINE_LEN]


Detailed Description

Handling of server messages
Author:
Chip Norkus

Max Byrd

Greg Poma

Definition in file server.c.


Function Documentation

void addUser char *  nick,
char *  user,
char *  host,
char *  name,
char *  mode
 

Add a new user, be that ChanServ or a nick in holding. in the 'mode' variable you can specify +iogsw or any other ircd compatible modes.

Used at services startup

Definition at line 153 of file server.c.

References myname, and sSend().

Referenced by addGhost(), main(), make_clone(), and parseLine().

void breakLine char *  tmpbuffer  ) 
 

Break up a string of data into seperate pieces and parse those. (parseLine())

Bug:
"I'm not sure but this function could be done better(?) if someone wants to improve it..."

Definition at line 182 of file server.c.

References FALSE, MAX_IRC_LINE_LEN, oldData, OperServ, parseLine(), sSend(), sshutdown(), strncpyzt, and TRUE.

Referenced by main().

int ConnectToServer char *  hostname,
int  portnum
 

Used at services startup to connect to its uplink.

Parameters:
hostname Hostname of uplink
IRC port Returns a file descriptor of a connected socket if successful.

Definition at line 60 of file server.c.

References corelog, flushLogs(), logDump(), and sshutdown().

Referenced by main().

void parseLine char *  line  ) 
 

Takes server data and "moshes it around in here to see what to do with it. :>"

"Also, I am assuming ircd will send commands in uppercase only, if this is not the case, then it should be fixed, strcasecmp is a more expensive function and all...."

Bug:
old lame bugfix, what would be better is to use a 'from' value and args++'ing it, if there's no prefix then have from set to the uplink -Mysid

Definition at line 273 of file server.c.

References adCheck(), addFlood(), addGhost(), addNewUser(), addUser(), addUserToChan(), _userlist::caccess, changeNick(), ChanServ, checkMemos(), checkTusers(), coreBuffer, CTime, delGhost(), delTimedGhost(), expireChans(), expireNicks(), _userlist::floodlevel, flushLogs(), GameServ, RateInfo::GetLev(), getNickData(), _userlist::host, service_struct::host, InfoServ, isAHurt(), isGhost(), isIgnored(), isOper(), loadakills(), MAX_IRC_LINE_LEN, MemoServ, motd(), myname, service_struct::name, NBANISH, nDesynch(), nextCsync, nextMsync, nextNsync, _userlist::nick, NickServ, NISAHURT, NISAWAY, NUMSERVS, _userlist::oflags, OperServ, OROOT, _userlist::reg, remUser(), remUserFromChan(), sendInfoReply(), sendToChanServ(), sendToGameServ(), sendToInfoServ(), sendToMemoServ(), sendToNickServ(), sendToOperServ(), setChanMode(), setChanTopic(), setFlags(), setMode(), sSend(), sshutdown(), strncpyzt, sync_cfg(), timer(), _userlist::user, VERSION_QUOTE, and VERSION_STRING.

Referenced by breakLine().

void sendInfoReply UserList nick  ) 
 

Respond to an /INFO message

Parameters:
nick Pointer to online user item

Definition at line 605 of file server.c.

References myname, _userlist::nick, services_info, and sSend().

Referenced by parseLine().

void sSend char *  format,
... 
 

a printf-like function for sending data to the services uplink socket

Parameters:
format Format string
... Variable-argument list

Definition at line 112 of file server.c.

References corelog, logDump(), net_write, sSend(), and sshutdown().

Referenced by adCloneMaintenance(), addAccessMask(), addakill(), addClone(), addNewUser(), addUser(), addUserToChan(), annoyNickThief(), applyAkill(), BadPwChan(), BadPwNick(), banKick(), breakLine(), CCMD(), changeNick(), changeNickOnAllChans(), checkAkillAllUsers(), checkTusers(), cleanChopList(), complainAboutEmail(), createGhostChannel(), cs_set_encrypt(), cs_set_mlock(), cs_set_passwd(), cs_set_string(), delAccessMask(), deleteGhostChannel(), delGhost(), detect_mass(), do_chanop_add(), do_chanop_list(), dumptimer(), expireChans(), GoodPwChan(), GoodPwNick(), gs_roll(), guest_cnick(), handler(), help(), is_listnews(), is_postnews(), is_save(), is_sendinfo(), killide(), listAkills(), listCloneAlerts(), loadakills(), IpcType::logMessage(), main(), make_clone(), motd(), nDesynch(), newsNag(), ns_mark(), ns_register(), ns_set_encrypt(), ns_set_passwd(), ns_set_url(), ns_setopflags(), os_match(), parseLine(), readChanData(), readMemoData(), readNickData(), readTriggerData(), remFromAllChans(), removeAkill(), removeAkillType(), remUserFromChan(), saveChanData(), saveChanUrls(), saveInfoData(), saveMemoData(), saveNickData(), saveTriggerData(), sendInfoReply(), sendToChanOps(), sendToChanOpsAlways(), sendToChanServ(), sendToGameServ(), sendToNickServ(), sendToOperServ(), setChanMode(), setChanTopic(), sSend(), sshutdown(), timer(), and updateCloneAlerts().


Variable Documentation

char oldData[MAX_IRC_LINE_LEN]
 

Necessary to keep previous unterminated data

Bug:
oldData: ugly global variable that ought not to be needed.. should be done on a socket basis or something(?)

Definition at line 173 of file server.c.

Referenced by breakLine().


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.