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"
54 // flags for use with WriteMode
59 // flags for use with OnUserPreMessage and OnUserPreNotice
62 #define TYPE_CHANNEL 2
65 #define IS_LOCAL(x) (x->fd > -1)
66 #define IS_REMOTE(x) (x->fd < 0)
67 #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER)
69 typedef void (handlerfunc) (char**, int, userrec*);
87 statsAccept = statsRefused = statsUnknown = 0;
88 statsCollisions = statsDns = statsDnsGood = 0;
89 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
98 void erase_factory(int j);
99 void erase_module(int j);
100 bool UnloadModule(const char* filename);
101 bool LoadModule(const char* filename);
104 InspIRCd(int argc, char** argv);
110 void force_nickchange(userrec* user,const char* newnick);
111 void kill_link(userrec *user,const char* r);
112 void kill_link_silent(userrec *user,const char* r);
113 void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user);
114 bool is_valid_cmd(const char* commandname, int pcnt, userrec * user);
115 std::string GetRevision();
116 int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
117 void AddWhoWas(userrec* u);
118 void ConnectUser(userrec *user);
119 userrec* ReHashNick(char* Old, char* New);
121 /* optimization tricks to save us walking the user hash */
122 void AddOper(userrec* user);
123 void DeleteOper(userrec* user);
124 void handle_version(char **parameters, int pcnt, userrec *user);
125 /* userrec optimization stuff */
126 void AddServerName(std::string servername);
127 const char* FindServerNamePtr(std::string servername);
128 std::string GetVersionString();
129 void* dns_task(void* arg);
130 void process_buffer(const char* cmdbuf,userrec *user);
131 void FullConnectUser(userrec* user);