1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #ifndef __INSPIRCD_H__
18 #define __INSPIRCD_H__
20 #include "inspircd_config.h"
29 #include <sys/types.h>
31 #ifndef _LINUX_C_LIB_VERSION
32 #include <sys/socket.h>
34 #include <netinet/in.h>
37 #include <arpa/inet.h>
41 #include "inspircd_io.h"
42 #include "inspircd_util.h"
55 // flags for use with WriteMode
60 // flags for use with OnUserPreMessage and OnUserPreNotice
63 #define TYPE_CHANNEL 2
66 #define IS_LOCAL(x) (x->fd > -1)
67 #define IS_REMOTE(x) (x->fd < 0)
68 #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER)
70 typedef void (handlerfunc) (char**, int, userrec*);
88 statsAccept = statsRefused = statsUnknown = 0;
89 statsCollisions = statsDns = statsDnsGood = 0;
90 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
99 void erase_factory(int j);
100 void erase_module(int j);
105 bool LoadModule(const char* filename);
106 bool UnloadModule(const char* filename);
107 InspIRCd(int argc, char** argv);
113 void force_nickchange(userrec* user,const char* newnick);
114 void kill_link(userrec *user,const char* r);
115 void kill_link_silent(userrec *user,const char* r);
116 void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user);
117 bool is_valid_cmd(const char* commandname, int pcnt, userrec * user);
118 std::string GetRevision();
119 int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
120 void AddWhoWas(userrec* u);
121 void ConnectUser(userrec *user);
122 userrec* ReHashNick(char* Old, char* New);
124 /* optimization tricks to save us walking the user hash */
125 void AddOper(userrec* user);
126 void DeleteOper(userrec* user);
127 void handle_version(char **parameters, int pcnt, userrec *user);
128 /* userrec optimization stuff */
129 void AddServerName(std::string servername);
130 const char* FindServerNamePtr(std::string servername);
131 std::string GetVersionString();
132 void* dns_task(void* arg);
133 void process_buffer(const char* cmdbuf,userrec *user);
134 void FullConnectUser(userrec* user);