summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-23 18:36:58 +0000
committerdane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-23 18:36:58 +0000
commit61a23cd017465cd2bff5f037cf54e051a6318b37 (patch)
tree5827cad42b833c88be5783d457ffb03b00c785bf /include
parent26ea4bc11b4e07bbeb95031f2337ff695f83cc16 (diff)
BUILD : 1.7.5 (327) BUGS : none NOTES : Merged anope-capab into main trunk...
git-svn-id: svn://svn.anope.org/anope/trunk@327 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@203 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r--include/bahamut.h55
-rw-r--r--include/commands.h18
-rw-r--r--include/dreamforge.h51
-rw-r--r--include/extern.h318
-rw-r--r--include/hybrid.h48
-rw-r--r--include/ptlink.h60
-rw-r--r--include/rageircd.h58
-rw-r--r--include/services.h1173
-rw-r--r--include/sysconf.h.in7
-rw-r--r--include/ultimate2.h63
-rw-r--r--include/ultimate3.h60
-rw-r--r--include/unreal31.h66
-rw-r--r--include/unreal32.h80
-rw-r--r--include/version.sh37
-rw-r--r--include/viagra.h76
15 files changed, 1217 insertions, 953 deletions
diff --git a/include/bahamut.h b/include/bahamut.h
new file mode 100644
index 000000000..e04729463
--- /dev/null
+++ b/include/bahamut.h
@@ -0,0 +1,55 @@
+/* Bahamut functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+/*************************************************************************/
+
+#ifdef IRC_BAHAMUT
+
+#define PROTECT_SET_MODE "+"
+#define PROTECT_UNSET_MODE "+"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_R 0x80000000
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_c 0x00000400 /* Colors can't be used */
+#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */
+#define CMODE_O 0x00008000 /* Only opers can join */
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+
diff --git a/include/commands.h b/include/commands.h
index 00a866219..28226b14f 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -20,15 +20,15 @@
* terminated with a NULL name.
*/
-extern Command *lookup_cmd(Command *list, const char *name);
-extern void run_cmd(const char *service, User *u, Command *list,
- const char *name);
-extern void help_cmd(const char *service, User *u, Command *list,
- const char *name);
-extern void do_run_cmd(const char *service, User * u, Command *c,const char *cmd);
-extern void do_help_cmd(const char *service, User * u, Command *c,const char *cmd);
-extern void mod_help_cmd(const char *service, User *u, CommandHash *cmdTable[],const char *cmd);
-extern void mod_run_cmd(const char *service, User *u, CommandHash *cmdTable[],const char *cmd);
+extern Command *lookup_cmd(Command *list, char *name);
+extern void run_cmd(char *service, User *u, Command *list,
+ char *name);
+extern void help_cmd(char *service, User *u, Command *list,
+ char *name);
+extern void do_run_cmd(char *service, User * u, Command *c,const char *cmd);
+extern void do_help_cmd(char *service, User * u, Command *c,const char *cmd);
+extern void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
+extern void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
extern char *mod_current_module_name;
/*************************************************************************/
diff --git a/include/dreamforge.h b/include/dreamforge.h
new file mode 100644
index 000000000..f5f3c755f
--- /dev/null
+++ b/include/dreamforge.h
@@ -0,0 +1,51 @@
+/* DreamForge IRCD functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_DREAMFORGE
+
+#define OWNER_SET_MODE "+"
+#define OWNER_UNSET_MODE "+"
+#define PROTECT_SET_MODE "+"
+#define PROTECT_UNSET_MODE "+"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_g 0x80000000
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+
diff --git a/include/extern.h b/include/extern.h
index fe02b446b..d7d9b71a4 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -19,23 +19,24 @@
#define E extern
+E char *uplink;
-/**** modules.c ****/
-E void moduleCallBackRun(void);
-E void moduleCleanStruct(ModuleData * moduleData[]);
+/* IRC Variables */
+E IRCDVar ircd[];
+E IRCDCAPAB ircdcap[];
/**** actions.c ****/
-E void change_user_mode(User * u, char *modes, char *arg);
-E void kill_user(const char *source, const char *user, const char *reason);
+E void kill_user(char *source, char *user, char *reason);
E void bad_password(User * u);
+E void sqline(char *mask, char *reason);
+E void common_unban(ChannelInfo * ci, char *nick);
+E void common_svsmode(User * u, char *modes, char *arg);
/**** botserv.c ****/
E BotInfo *botlists[256];
-
E void get_botserv_stats(long *nrec, long *memuse);
-
E void bs_init(void);
E void botserv(User *u, char *buf);
E void botmsgs(User *u, BotInfo *bi, char *buf);
@@ -43,7 +44,6 @@ E void botchanmsgs(User *u, ChannelInfo *ci, char *buf);
E void load_bs_dbase(void);
E void save_bs_dbase(void);
E void save_bs_rdb_dbase(void);
-
E BotInfo *makebot(char *nick);
E BotInfo *findbot(char *nick);
E void bot_join(ChannelInfo *ci);
@@ -54,6 +54,30 @@ E void bot_rejoin_all(BotInfo *bi);
E Channel *chanlist[1024];
E CBMode cbmodes[128];
E CBModeInfo cbmodeinfos[];
+E CUMode cumodes[128];
+E CMMode cmmodes[128];
+E unsigned long umodes[128];
+E char csmodes[128];
+
+extern void do_mass_mode(char *modes);
+extern void add_ban(Channel * chan, char *mask);
+extern void chan_adduser2(User * user, Channel * c);
+extern void chan_delete(Channel * c);
+extern void del_ban(Channel * chan, char *mask);
+extern void set_key(Channel * chan, char *value);
+extern void set_limit(Channel * chan, char *value);
+extern char *get_key(Channel * chan);
+extern char *get_limit(Channel * chan);
+extern Channel *chan_create(char *chan);
+extern Channel *join_user_update(User * user, Channel * chan, char *name);
+
+extern void add_exception(Channel * chan, char *mask);
+extern void del_exception(Channel * chan, char *mask);
+extern char *get_flood(Channel * chan);
+extern void set_flood(Channel * chan, char *value);
+extern char *get_redirect(Channel * chan);
+extern void set_redirect(Channel * chan, char *value);
+
E void get_channel_stats(long *nrec, long *memuse);
E Channel *findchan(const char *chan);
@@ -84,6 +108,7 @@ E void do_part(const char *source, int ac, char **av);
E void do_sjoin(const char *source, int ac, char **av);
E void do_topic(const char *source, int ac, char **av);
E void do_mass_mode(char *modes);
+
#define whosends(ci) ((!(ci) || !((ci)->botflags & BS_SYMBIOSIS) || !(ci)->bi || !(ci)->c || (ci)->c->usercount < BSMinUsers) ? s_ChanServ : (ci)->bi->nick)
/**** chanserv.c ****/
@@ -107,25 +132,16 @@ E void cs_remove_nick(const NickCore * nc);
E void cs_remove_bot(const BotInfo * bi);
E void check_modes(Channel * c);
-#if defined(IRC_ULTIMATE3) || defined(IRC_RAGE2)
E int check_valid_admin(User * user, Channel * chan, int servermode);
-#endif
E int check_valid_op(User * user, Channel * chan, int servermode);
-E int check_should_op(User * user, const char *chan);
-E int check_should_voice(User * user, const char *chan);
-#ifdef HAS_HALFOP
-E int check_should_halfop(User * user, const char *chan);
-#endif
-#if defined(IRC_UNREAL) || defined(IRC_VIAGRA)
-E int check_should_owner(User * user, const char *chan);
-E int check_should_protect(User * user, const char *chan);
-#endif
-#if defined(IRC_ULTIMATE3) || defined(IRC_RAGE2) || defined(IRC_PTLINK)
-E int check_should_protect(User * user, const char *chan);
-#endif
+E int check_should_op(User * user, char *chan);
+E int check_should_voice(User * user, char *chan);
+E int check_should_halfop(User * user, char *chan);
+E int check_should_owner(User * user, char *chan);
+E int check_should_protect(User * user, char *chan);
E int check_kick(User * user, char *chan);
E void record_topic(const char *chan);
-E void restore_topic(const char *chan);
+E void restore_topic(char *chan);
E int check_topiclock(Channel * c, time_t topic_time);
E ChannelInfo *cs_findchan(const char *chan);
@@ -138,19 +154,14 @@ E int get_idealban(ChannelInfo * ci, User * u, char *ret, int retlen);
E AutoKick *is_stuck(ChannelInfo * ci, char *mask);
E void stick_mask(ChannelInfo * ci, AutoKick * akick);
E void stick_all(ChannelInfo * ci);
-
-#ifdef HAS_FMODE
E char *cs_get_flood(ChannelInfo * ci);
E void cs_set_flood(ChannelInfo * ci, char *value);
-#endif
E char *cs_get_key(ChannelInfo * ci);
E void cs_set_key(ChannelInfo * ci, char *value);
E char *cs_get_limit(ChannelInfo * ci);
E void cs_set_limit(ChannelInfo * ci, char *value);
-#ifdef HAS_LMODE
E char *cs_get_redirect(ChannelInfo * ci);
E void cs_set_redirect(ChannelInfo * ci, char *value);
-#endif
/**** compat.c ****/
@@ -482,10 +493,20 @@ E char *DefconMessage;
E char *DefConAkillReason;
E char *DefConOffMessage;
+E int Numeric;
+
/**** converter.c ****/
E int convert_ircservices_44(void);
+/**** helpserv.c ****/
+E void helpserv(User * u, char *buf);
+E void helpserv_init(void);
+
+/**** hostserv.c ****/
+E void hostserv_init(void);
+E void addHostCore(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time);
+
/**** init.c ****/
E void introduce_user(const char *user);
@@ -505,7 +526,7 @@ E void lang_init(void);
(langtexts[((nc)?((NickCore*)nc)->language:NSDefLanguage)][(index)])
E int strftime_lang(char *buf, int size, User * u, int format,
struct tm *tm);
-E void syntax_error(const char *service, User * u, const char *command,
+E void syntax_error(char *service, User * u, char *command,
int msgnum);
@@ -555,7 +576,6 @@ E int do_mysql;
#endif
E int is44;
-
E int quitting;
E int delayed_quit;
E char *quitmsg;
@@ -581,18 +601,28 @@ E void ms_init(void);
E void memoserv(User * u, char *buf);
E void check_memos(User * u);
+/**** messages.c ****/
+
+E int m_nickcoll(char *user);
+E int m_away(char *source, char *msg);
+E int m_kill(char *nick, char *msg);
+E int m_motd(char *source);
+E int m_privmsg(char *source, char *receiver, char *msg);
+E int m_stats(char *source, int ac, char **av);
+E int m_whois(char *source, char *who);
+E int m_time(char *source, int ac, char **av);
+E int m_version(char *source, int ac, char **av);
+
/**** misc.c ****/
+
E char *strscpy(char *d, const char *s, size_t len);
E char *stristr(char *s1, char *s2);
E char *strnrepl(char *s, int32 size, const char *old, const char *new);
-
E char *merge_args(int argc, char **argv);
-
E int match_wild(const char *pattern, const char *str);
E int match_wild_nocase(const char *pattern, const char *str);
-
E int dotime(const char *s);
E char *duration(NickAlias * na, char *buf, int bufsize, time_t seconds);
E char *expire_left(NickAlias * na, char *buf, int len, time_t expires);
@@ -615,11 +645,18 @@ E void EnforceQlinedNick(char *nick, char *killer);
E int nickIsServices(char *nick);
+E const char* inttobase64(char* buf, unsigned int v, unsigned int count);
+E unsigned int base64toIP(const char* s);
+E unsigned int base64toint(const char* s);
+
+/**** modules.c ****/
+E void moduleCallBackRun(void);
+E void moduleCleanStruct(ModuleData * moduleData[]);
+
/**** news.c ****/
E int32 nnews, news_size;
E NewsItem *news;
-
E void get_news_stats(long *nrec, long *memuse);
E void load_news(void);
E void save_news(void);
@@ -629,15 +666,12 @@ E int do_logonnews(User * u);
E int do_opernews(User * u);
E int do_randomnews(User * u);
-
/**** nickserv.c ****/
E NickAlias *nalists[1024];
E NickCore *nclists[1024];
E NickRequest *nrlists[1024];
-
E unsigned int guestnum;
-
E void insert_requestnick(NickRequest * nr);
E void alpha_insert_alias(NickAlias * na);
E void insert_core(NickCore * nc);
@@ -660,23 +694,14 @@ E int nick_recognized(User * u);
E void expire_nicks(void);
E void expire_requests(void);
E int ns_do_register(User * u);
-
E int delnick(NickAlias * na);
E NickAlias *findnick(const char *nick);
E NickCore *findcore(const char *nick);
E void clean_ns_timeouts(NickAlias * na);
-
E void nsStartNickTracking(User * u);
E void nsStopNickTracking(User * u);
E int nsCheckNickTracking(User *u);
-/**** helpserv.c ****/
-E void helpserv(User * u, char *buf);
-E void helpserv_init(void);
-
-/**** hostserv.c ****/
-E void hostserv_init(void);
-E void addHostCore(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time);
/**** operserv.c ****/
@@ -699,32 +724,28 @@ E int nick_is_services_admin(NickCore *nc);
E int nick_is_services_oper(NickCore *nc);
E int add_akill(User *u, char *mask, const char *by, const time_t expires, const char *reason);
-E int check_akill(const char *nick, const char *username, const char *host, const char *vhost, const char *ip);
+E int check_akill(char *nick, const char *username, const char *host, const char *vhost, const char *ip);
E void expire_akills(void);
E void oper_global(char *nick, char *fmt, ...);
-#ifdef IRC_BAHAMUT
+
E int add_sgline(User *u, char *mask, const char *by, const time_t expires, const char *reason);
-E int check_sgline(const char *nick, const char *realname);
+E int check_sgline(char *nick, const char *realname);
E void expire_sglines(void);
-#endif
E int add_sqline(User *u, char *mask, const char *by, const time_t expires, const char *reason);
-E int check_sqline(const char *nick, int nick_change);
-#ifdef IRC_BAHAMUT
-E int check_chan_sqline(const char *chan);
-#endif
+E int check_sqline(char *nick, int nick_change);
E void expire_sqlines(void);
+E int check_chan_sqline(const char *chan);
-#ifdef IRC_BAHAMUT
E int add_szline(User * u, char *mask, const char *by,
const time_t expires, const char *reason);
E void expire_szlines(void);
-#endif
E void check_clones(User * user);
-
E void delete_ignore(const char *nick);
+E Server *server_global(Server * s, char *msg);
+
/**** process.c ****/
E int allow_ignore;
@@ -736,19 +757,6 @@ E IgnoreData *get_ignore(const char *nick);
E int split_buf(char *buf, char ***argv, int colon_special);
E void process(void);
-/**** protocol.c ****/
-
-E void s_akill(char *user, char *host, char *who, time_t when,
- time_t expires, char *reason);
-E void s_rakill(char *user, char *host);
-E void s_sgline(char *mask, char *reason);
-E void s_sqline(char *mask, char *reason);
-E void s_svsnoop(char *server, int set);
-E void s_szline(char *mask, char *reason);
-E void s_unsgline(char *mask);
-E void s_unsqline(char *mask);
-E void s_unszline(char *mask);
-
/**** proxy.c ****/
E HostCache *hcache[1024];
@@ -769,44 +777,33 @@ E void send_cmd(const char *source, const char *fmt, ...)
E void vsend_cmd(const char *source, const char *fmt, va_list args)
FORMAT(printf,2,0);
-E void wallops(const char *source, const char *fmt, ...)
- FORMAT(printf,2,3);
-
-E void notice(const char *source, const char *dest, const char *fmt, ...)
+E void notice_server(char *source, Server * s, char *fmt, ...)
FORMAT(printf,3,4);
-E void notice_server(const char *source, Server *s, const char *fmt, ...)
+E void notice_user(char *source, User *u, const char *fmt, ...)
FORMAT(printf,3,4);
-E void notice_user(const char *source, User *u, const char *fmt, ...)
- FORMAT(printf,3,4);
-
-E void notice_list(const char *source, const char *dest, const char **text);
-E void notice_lang(const char *source, User *dest, int message, ...);
-E void notice_help(const char *source, User *dest, int message, ...);
-E void privmsg(const char *source, const char *dest, const char *fmt, ...)
- FORMAT(printf,3,4);
+E void notice_list(char *source, char *dest, char **text);
+E void notice_lang(char *source, User *dest, int message, ...);
+E void notice_help(char *source, User *dest, int message, ...);
-E void send_mode(const char *source, const char *on, const char *fmt, ...)
- FORMAT(printf,3,4);
/**** servers.c ****/
E Server *servlist;
E Server *me_server;
-#ifdef IRC_BAHAMUT
-E uint16 uplink_capab;
-#endif
+E uint32 uplink_capab;
E Server *first_server(int flags);
E Server *next_server(int flags);
-E Server *new_server(Server *uplink, const char *name, const char *desc,
- uint16 flags);
+E Server *new_server(Server * uplink, const char *name, const char *desc,
+ uint16 flags);
E Server *findserver(Server *s, const char *name);
E void do_server(const char *source, int ac, char **av);
E void do_squit(const char *source, int ac, char **av);
+E void capab_parse(int ac, char **av);
/**** sessions.c ****/
@@ -817,7 +814,7 @@ E void get_session_stats(long *nrec, long *memuse);
E void get_exception_stats(long *nrec, long *memuse);
E int do_session(User *u);
-E int add_session(const char *nick, const char *host);
+E int add_session(char *nick, char *host);
E void del_session(const char *host);
E void load_exceptions(void);
@@ -848,36 +845,31 @@ E User *userlist[1024];
E int32 usercnt, opcnt, maxusercnt;
E time_t maxusertime;
-E void set_umode(User * user, int ac, char **av);
-
E void delete_user(User *user);
E void get_user_stats(long *nusers, long *memuse);
E User *finduser(const char *nick);
E User *firstuser(void);
E User *nextuser(void);
+E User *finduser_uid(const char *uid);
-#if defined(IRC_ULTIMATE) || defined(IRC_UNREAL) || defined(IRC_ULTIMATE3) || defined(IRC_VIAGRA) || defined(IRC_PTLINK) || defined(IRC_RAGE2)
+E void update_host(User * user);
E void change_user_host(User * user, const char *host);
-#endif
-#if defined(IRC_ULTIMATE) || defined(IRC_UNREAL) || defined(IRC_ULTIMATE3) || defined(IRC_VIAGRA) || defined(IRC_PTLINK)
E void change_user_username(User * user, const char *username);
E void change_user_realname(User * user, const char *realname);
-#endif
E User *do_nick(const char *source, char *nick, char *username, char *host,
- char *server, char *realname, time_t ts, uint32 svid, ...);
+ char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid);
+
E void do_umode(const char *source, int ac, char **av);
E void do_quit(const char *source, int ac, char **av);
-E void do_kill(const char *source, int ac, char **av);
+E void do_kill(char *source, char *reason);
E int is_oper(User * user);
E int is_protected(User * user);
-#ifdef HAS_EXCEPT
E int is_excepted(ChannelInfo * ci, User * user);
E int is_excepted_mask(ChannelInfo * ci, char *mask);
-#endif
E int match_usermask(const char *mask, User * user);
E void split_usermask(const char *mask, char **nick, char **user,
@@ -922,4 +914,128 @@ extern int encrypt_in_place(char *buf, int size);
#endif
+E void privmsg(char *source, char *dest, const char *fmt, ...);
+E void notice(char *source, char *dest, const char *fmt, ...);
+
+/******************************************************************************/
+
+extern void anope_cmd_211(const char *fmt, ...); /* 211 */
+extern void anope_cmd_219(char *source, char *who); /* 219 */
+extern void anope_cmd_242(const char *fmt, ...); /* 242 */
+extern void anope_cmd_243(const char *fmt, ...); /* 243 */
+extern void anope_cmd_250(const char *fmt, ...); /* 250 */
+extern void anope_cmd_307(const char *fmt, ...); /* 307 */
+extern void anope_cmd_311(const char *fmt, ...); /* 311 */
+extern void anope_cmd_312(const char *fmt, ...); /* 312 */
+extern void anope_cmd_317(const char *fmt, ...); /* 317 */
+extern void anope_cmd_318(char *source, char *who); /* 318 */
+extern void anope_cmd_351(char *source); /* 351 */
+extern void anope_cmd_372(char *source, char *msg); /* 372 */
+extern void anope_cmd_372_error(char *source); /* 372 */
+extern void anope_cmd_375(char *source); /* 375 */
+extern void anope_cmd_376(char *source); /* 376 */
+extern void anope_cmd_391(char *source, char *timestr); /* 391 */
+extern void anope_cmd_401(char *source, char *who); /* 401 */
+extern void anope_cmd_akill(char *user, char *host, char *who, time_t when, time_t expires, char *reason); /* AKILL */
+extern void anope_cmd_capab(); /* CAPAB */
+extern void anope_cmd_chghost(char *nick, char *vhost); /* CHGHOST */
+extern void anope_cmd_chgident(char *nick, char *vIdent); /* CHGIDENT */
+extern void anope_cmd_vhost_on(char *nick, char *vIdent, char *vhost); /* CHGHOST + CHGIDENT */
+extern void anope_cmd_vhost_off(char *nick);
+extern void anope_cmd_connect(int servernum); /* Connect */
+extern void anope_cmd_ea(); /* EA */
+extern void anope_cmd_global(char *source, const char *fmt, ...); /* GLOBOPS */
+extern void anope_cmd_invite(char *source, char *chan, char *nick); /* INVITE */
+extern void anope_cmd_join(char *user, char *channel, time_t chantime); /* JOIN */
+extern void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt, ...); /* KICK */
+extern void anope_cmd_mode(char *source, char *dest, const char *fmt, ...); /* MODE */
+extern void anope_cmd_unban(char *name, char *nick); /* MODE -b */
+extern void anope_cmd_bot_chan_mode(char *nick, char *chan); /* MODE BotServ */
+extern void anope_cmd_netinfo(int ac, char **av); /* NETINFO */
+extern void anope_cmd_nick(char *nick, char *name, char *mode); /* NICK */
+extern void anope_cmd_chg_nick(char *oldnick, char *newnick); /* NICK */
+extern void anope_cmd_bot_nick(char *nick, char *user,char *host,char *real,char *modes); /* NICK */
+extern void anope_cmd_guest_nick(char *nick, char *user,char *host,char *real,char *modes); /* NICK */
+extern void anope_cmd_notice(char *source, char *dest, const char *fmt, ...); /* NOTICE */
+extern void anope_cmd_notice_ops(char *source, char *dest, const char *fmt, ...); /* NOTICE */
+extern void anope_cmd_notice2(char *source, char *dest, char *msg); /* NOTICE */
+extern void anope_cmd_serv_notice(char *source, char *dest, char *msg); /* NOTICE */
+extern void anope_cmd_part(char *nick, char *chan, const char *fmt, ...); /* PART */
+extern void anope_cmd_pass(char *pass); /* PASS */
+extern void anope_cmd_pong(char *servname, char *who); /* PONG */
+extern void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...); /* PRIVMSG */
+extern void anope_cmd_privmsg2(char *source, char *dest, char *msg); /* PRIVMSG */
+extern void anope_cmd_serv_privmsg(char *source, char *dest, char *msg); /* PRIVMSG */
+extern void anope_cmd_protoctl(); /* PROTOCTL */
+extern void anope_cmd_quit(char *source, const char *fmt, ...); /* QUIT */
+extern void anope_cmd_remove_akill(char *user, char *host); /* RAKILL */
+extern void anope_cmd_server(char *servname, int hop, char *descript); /* SERVER */
+extern void anope_cmd_sgline(char *mask, char *reason); /* SGLINE */
+extern void anope_cmd_sqline(char *mask, char *reason); /* SQLINE */
+extern void anope_cmd_szline(char *mask, char *reason); /* SZLINE */
+extern void anope_cmd_squit(char *servname, char *message); /* SQUIT */
+extern void anope_cmd_svinfo(); /* SVINFO */
+extern void anope_cmd_svshold(char *nick); /* SVSHOLD */
+extern void anope_cmd_relase_svshold(char *nick); /* SVSHOLD */
+extern void anope_cmd_svsinfo(); /* SVSINFO */
+extern void anope_cmd_svskill(char *source,char *user, const char *fmt, ...); /* SVSKILL */
+extern void anope_cmd_svsmode(User * u, int ac, char **av); /* SVSMODE */
+extern void anope_cmd_svsnick(char *nick,char *newnick, time_t when); /* SVSNICK */
+extern void anope_cmd_svsnoop(char *server, int set); /* SVSNOOP */
+extern void anope_cmd_svso(char *source,char *nick, char *flag); /* SVSO */
+extern void anope_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); /* TOPIC */
+extern void anope_cmd_unsgline(char *mask); /* UNSGLINE */
+extern void anope_cmd_unsqline(char *user); /* UNSQLINE */
+extern void anope_cmd_unszline(char *mask); /* UNSZLINE */
+
+extern int anope_event_436(char *source, int ac, char **av);
+extern int anope_event_away(char *source, int ac, char **av);
+extern int anope_event_ping(char *source, int ac, char **av);
+extern int anope_event_motd(char *source, int ac, char **av);
+extern int anope_event_join(char *source, int ac, char **av);
+extern int anope_event_kick(char *source, int ac, char **av);
+extern int anope_event_kill(char *source, int ac, char **av);
+extern int anope_event_mode(char *source, int ac, char **av);
+extern int anope_event_quit(char *source, int ac, char **av);
+extern int anope_event_squit(char *source, int ac, char **av);
+extern int anope_event_topic(char *source, int ac, char **av);
+extern int anope_event_whois(char *source, int ac, char **av);
+extern int anope_event_part(char *source, int ac, char **av);
+extern int anope_event_server(char *source, int ac, char **av);
+extern int anope_event_nick(char *source, int ac, char **av);
+extern int anope_event_privmsg(char *source, int ac, char **av);
+extern int anope_event_capab(char *source, int ac, char **av);
+extern int anope_event_sjoin(char *source, int ac, char **av);
+extern int anope_event_cs(char *source, int ac, char **av);
+extern int anope_event_hs(char *source, int ac, char **av);
+extern int anope_event_ms(char *source, int ac, char **av);
+extern int anope_event_ns(char *source, int ac, char **av);
+extern int anope_event_os(char *source, int ac, char **av);
+extern int anope_event_vs(char *source, int ac, char **av);
+extern int anope_event_svinfo(char *source, int ac, char **av);
+extern int anope_event_chghost(char *source, int ac, char **av);
+extern int anope_event_sethost(char *source, int ac, char **av);
+extern int anope_event_chgident(char *source, int ac, char **av);
+extern int anope_event_setident(char *source, int ac, char **av);
+extern int anope_event_chgname(char *source, int ac, char **av);
+extern int anope_event_setname(char *source, int ac, char **av);
+extern int anope_event_svsinfo(char *source, int ac, char **av);
+extern int anope_event_snick(char *source, int ac, char **av);
+extern int anope_event_vhost(char *source, int ac, char **av); /* Rage IRCD Only */
+extern int anope_event_tkl(char *source, int ac, char **av);
+extern int anope_event_eos(char *source, int ac, char **av);
+extern int anope_event_pass(char *source, int ac, char **av);
+extern int anope_event_netinfo(char *source, int ac, char **av);
+extern int anope_event_error(char *source, int ac, char **av);
+extern int anope_event_eb(char *source, int ac, char **av);
+
+extern void anope_set_umode(User * user, int ac, char **av);
+extern void anope_cmd_svid_umode(char *nick, time_t ts);
+extern void anope_cmd_svid_umode2(User *u, char *ts);
+extern void anope_cmd_svid_umode3(User *u, char *ts);
+extern void anope_cmd_nc_change(User *u);
+
+extern char *common_get_vident(User *u);
+extern char *common_get_vhost(User *u);
+
#endif /* EXTERN_H */
diff --git a/include/hybrid.h b/include/hybrid.h
new file mode 100644
index 000000000..58664e01a
--- /dev/null
+++ b/include/hybrid.h
@@ -0,0 +1,48 @@
+/* Hybrid IRCD functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_HYBRID
+
+#define PROTECT_SET_MODE "+"
+#define PROTECT_UNSET_MODE "+"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_a 0x00000400
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t
+
+#endif
+
+
diff --git a/include/ptlink.h b/include/ptlink.h
new file mode 100644
index 000000000..ca031b720
--- /dev/null
+++ b/include/ptlink.h
@@ -0,0 +1,60 @@
+/* PTLink IRCD functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_PTLINK
+
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_A 0x00000400
+#define CMODE_B 0x00000800
+#define CMODE_c 0x00001000
+#define CMODE_d 0x00002000
+#define CMODE_f 0x00004000
+#define CMODE_K 0x00008000
+#define CMODE_O 0x00010000
+#define CMODE_q 0x00020000
+#define CMODE_S 0x00040000
+#define CMODE_N 0x00080000
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+
+
diff --git a/include/rageircd.h b/include/rageircd.h
new file mode 100644
index 000000000..e130e6756
--- /dev/null
+++ b/include/rageircd.h
@@ -0,0 +1,58 @@
+/* Rage IRCD functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_RAGE2
+
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define FANT_PROTECT_ADD "!admin"
+#define FANT_PROTECT_DEL "!deadmin"
+#define LEVEL_PROTECT_WORD "AUTOADMIN"
+#define LEVELINFO_PROTECT_WORD "ADMIN"
+#define LEVELINFO_PROTECTME_WORD "ADMINME"
+#define CS_CMD_PROTECT "ADMIN"
+#define CS_CMD_DEPROTECT "DEADMIN"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_R 0x80000000
+#define UMODE_x 0x40000000
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_A 0x00000800
+#define CMODE_N 0x00001000
+#define CMODE_S 0x00002000
+#define CMODE_C 0x00004000
+#define CMODE_c 0x00000400 /* Colors can't be used */
+#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */
+#define CMODE_O 0x00008000 /* Only opers can join */
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+#define CMODE_I 0x08000000
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+
diff --git a/include/services.h b/include/services.h
index 8fcdba9d4..52cd43a1c 100644
--- a/include/services.h
+++ b/include/services.h
@@ -57,9 +57,13 @@
#ifdef USE_MYSQL
# define MYSQL_WARNING 2
# define MYSQL_ERROR 4
-
-#include "mysql.h"
-#include "errmsg.h"
+#ifdef HAVE_MYSQL_MYSQL_H
+# include <mysql.h>
+# include <errmsg.h>
+#else
+# include <mysql/mysql.h>
+# include <mysql/errmsg.h>
+#endif
#endif
#if HAVE_STRINGS_H
@@ -124,280 +128,155 @@ extern int toupper(char), tolower(char);
typedef struct server_ Server;
typedef struct user_ User;
typedef struct channel_ Channel;
+typedef struct ModuleData_ ModuleData; /* ModuleData struct */
+typedef struct ModuleDataItem_ ModuleDataItem; /* A Module Data Item struct */
+typedef struct memo_ Memo;
+typedef struct nickrequest_ NickRequest;
+typedef struct nickalias_ NickAlias;
+typedef struct nickcore_ NickCore;
+typedef struct botinfo_ BotInfo;
+typedef struct chaninfo_ ChannelInfo;
+typedef struct badword_ BadWord;
+typedef struct bandata_ BanData;
+typedef struct userdata_ UserData;
+typedef struct mailinfo_ MailInfo;
+typedef struct akill_ Akill;
+typedef struct sxline_ SXLine;
+typedef struct hostcore_ HostCore;
+typedef struct newsitem_ NewsItem;
+typedef struct hostcache_ HostCache;
+typedef struct exception_ Exception;
+typedef struct cbmode_ CBMode;
+typedef struct cbmodeinfo_ CBModeInfo;
+typedef struct cmmode_ CMMode;
+typedef struct csmode_ CSMode;
+typedef struct cumode_ CUMode;
+typedef struct csmodeutil_ CSModeUtil;
/*************************************************************************/
-/*************************************************************************/
-/* Protocol tweaks */
-
-
-
-#ifdef IRC_HYBRID
-# define HAS_HALFOP
-# define HAS_EXCEPT /* Has +e (chan excepts) */
-# define NICKSERV_MODE "+o"
-# define CHANSERV_MODE "+o"
-# define MEMOSERV_MODE "+o"
-# define BOTSERV_MODE "+o"
-# define HELPSERV_MODE "+h"
-# define OPERSERV_MODE "+io"
-# define DEVNULL_MODE "+i"
-# define GLOBAL_MODE "+io"
-# define NICKSERV_ALIAS_MODE "+o"
-# define CHANSERV_ALIAS_MODE "+o"
-# define MEMOSERV_ALIAS_MODE "+o"
-# define BOTSERV_ALIAS_MODE "+o"
-# define HELPSERV_ALIAS_MODE "+h"
-# define OPERSERV_ALIAS_MODE "+io"
-# define DEVNULL_ALIAS_MODE "+i"
-# define GLOBAL_ALIAS_MODE "+io"
-# define BOTSERV_BOTS_MODE "+"
-#endif
-
-#ifdef IRC_VIAGRA
-# define HAS_HALFOP
-# define HAS_VHOST
-# define HAS_VIDENT
-# define HAS_EXCEPT
-# define NICKSERV_MODE "+oS"
-# define CHANSERV_MODE "+oS"
-# define HOSTSERV_MODE "+oS"
-# define MEMOSERV_MODE "+oS"
-# define BOTSERV_MODE "+oS"
-# define HELPSERV_MODE "+oS"
-# define OPERSERV_MODE "+ioS"
-# define DEVNULL_MODE "+i"
-# define GLOBAL_MODE "+ioS"
-# define NICKSERV_ALIAS_MODE "+oS"
-# define CHANSERV_ALIAS_MODE "+oS"
-# define MEMOSERV_ALIAS_MODE "+oS"
-# define BOTSERV_ALIAS_MODE "+oS"
-# define HELPSERV_ALIAS_MODE "+oS"
-# define OPERSERV_ALIAS_MODE "+ioS"
-# define DEVNULL_ALIAS_MODE "+iS"
-# define GLOBAL_ALIAS_MODE "+ioS"
-# define HOSTSERV_ALIAS_MODE "+ioS"
-# define BOTSERV_BOTS_MODE "+qS"
-#endif
+typedef enum { false, true } boolean;
-#if defined(IRC_BAHAMUT)
-# define HAS_NICKIP
- #if !defined(IRC_ULTIMATE3) && !defined(IRC_VIAGRA) && !defined(IRC_RAGE2)
-# define HAS_EXCEPT
-# define HAS_SVSHOLD
-# define NICKSERV_MODE "+o"
-# define CHANSERV_MODE "+o"
-# define MEMOSERV_MODE "+o"
-# define BOTSERV_MODE "+o"
-# define HELPSERV_MODE "+h"
-# define OPERSERV_MODE "+io"
-# define DEVNULL_MODE "+i"
-# define GLOBAL_MODE "+io"
-# define NICKSERV_ALIAS_MODE "+o"
-# define CHANSERV_ALIAS_MODE "+o"
-# define MEMOSERV_ALIAS_MODE "+o"
-# define BOTSERV_ALIAS_MODE "+o"
-# define HELPSERV_ALIAS_MODE "+h"
-# define OPERSERV_ALIAS_MODE "+io"
-# define DEVNULL_ALIAS_MODE "+i"
-# define GLOBAL_ALIAS_MODE "+io"
-# define BOTSERV_BOTS_MODE "+"
- #endif
-#endif
+/*************************************************************************/
-#ifdef IRC_RAGE2
-# define HAS_HALFOP
-# define HAS_EXCEPT
-# define HAS_VHOST
-# define HAS_NICKVHOST
-# define NICKSERV_MODE "+dS"
-# define CHANSERV_MODE "+dS"
-# define HOSTSERV_MODE "+dS"
-# define MEMOSERV_MODE "+dS"
-# define BOTSERV_MODE "+dS"
-# define HELPSERV_MODE "+dSh"
-# define OPERSERV_MODE "+diS"
-# define DEVNULL_MODE "+diS"
-# define GLOBAL_MODE "+diS"
-# define NICKSERV_ALIAS_MODE "+o"
-# define CHANSERV_ALIAS_MODE "+o"
-# define MEMOSERV_ALIAS_MODE "+o"
-# define BOTSERV_ALIAS_MODE "+o"
-# define HELPSERV_ALIAS_MODE "+h"
-# define OPERSERV_ALIAS_MODE "+io"
-# define DEVNULL_ALIAS_MODE "+i"
-# define GLOBAL_ALIAS_MODE "+io"
-# define HOSTSERV_ALIAS_MODE "+io"
-# define BOTSERV_BOTS_MODE "+S"
-#endif
+/* Protocol tweaks */
-#ifdef IRC_PTLINK
-# define HAS_NICKVHOST
-# define HAS_VHOST
-# define HAS_FMODE
-# define HAS_EXCEPT
-# define NICKSERV_MODE "+o"
-# define CHANSERV_MODE "+o"
-# define HOSTSERV_MODE "+o"
-# define MEMOSERV_MODE "+o"
-# define BOTSERV_MODE "+o"
-# define HELPSERV_MODE "+h"
-# define OPERSERV_MODE "+io"
-# define DEVNULL_MODE "+i"
-# define GLOBAL_MODE "+io"
-# define NICKSERV_ALIAS_MODE "+o"
-# define CHANSERV_ALIAS_MODE "+o"
-# define MEMOSERV_ALIAS_MODE "+o"
-# define BOTSERV_ALIAS_MODE "+o"
-# define HELPSERV_ALIAS_MODE "+h"
-# define OPERSERV_ALIAS_MODE "+io"
-# define DEVNULL_ALIAS_MODE "+i"
-# define GLOBAL_ALIAS_MODE "+io"
-# define HOSTSERV_ALIAS_MODE "+io"
-# define BOTSERV_BOTS_MODE "+"
-#endif
-#ifdef IRC_ULTIMATE
-# define HAS_FMODE /* Has +f chan mode */
-# define HAS_HALFOP
-# define HAS_LMODE /* Has +L chan mode */
-# define HAS_VHOST
-# define HAS_VIDENT /* Can the IRCD Change Idents on the fly */
-# define HAS_EXCEPT
-# define NICKSERV_MODE "+S"
-# define CHANSERV_MODE "+S"
-# define HOSTSERV_MODE "+oS"
-# define MEMOSERV_MODE "+S"
-# define BOTSERV_MODE "+S"
-# define HELPSERV_MODE "+Sh"
-# define OPERSERV_MODE "+iS"
-# define DEVNULL_MODE "+iS"
-# define GLOBAL_MODE "+iS"
-# define NICKSERV_ALIAS_MODE "+oS"
-# define CHANSERV_ALIAS_MODE "+oS"
-# define MEMOSERV_ALIAS_MODE "+oS"
-# define BOTSERV_ALIAS_MODE "+oS"
-# define HELPSERV_ALIAS_MODE "+oS"
-# define OPERSERV_ALIAS_MODE "+ioS"
-# define DEVNULL_ALIAS_MODE "+iS"
-# define GLOBAL_ALIAS_MODE "+ioS"
-# define HOSTSERV_ALIAS_MODE "+ioS"
-# define BOTSERV_BOTS_MODE "+pS"
-#endif
+#include "hybrid.h"
+#include "viagra.h"
+#include "bahamut.h"
+#include "rageircd.h"
+#include "ptlink.h"
+#include "ultimate2.h"
+#include "unreal31.h"
+#include "ultimate3.h"
+#include "dreamforge.h"
+#include "unreal32.h"
-#ifdef IRC_UNREAL
-# define HAS_FMODE /* Has +f chan mode */
-# define HAS_HALFOP
-# define HAS_LMODE /* Has +L chan mode */
-# define HAS_NICKVHOST
-# define HAS_VHOST
-# define HAS_VIDENT /* Can the IRCD Change Idents on the fly */
-# define HAS_EXCEPT
-# define NICKSERV_MODE "+oS"
-# define CHANSERV_MODE "+oS"
-# define HOSTSERV_MODE "+oS"
-# define MEMOSERV_MODE "+oS"
-# define BOTSERV_MODE "+oS"
-# define HELPSERV_MODE "+oS"
-# define OPERSERV_MODE "+ioS"
-# define DEVNULL_MODE "+iS"
-# define GLOBAL_MODE "+ioS"
-# define NICKSERV_ALIAS_MODE "+oS"
-# define CHANSERV_ALIAS_MODE "+oS"
-# define MEMOSERV_ALIAS_MODE "+oS"
-# define BOTSERV_ALIAS_MODE "+oS"
-# define HELPSERV_ALIAS_MODE "+oS"
-# define OPERSERV_ALIAS_MODE "+ioS"
-# define DEVNULL_ALIAS_MODE "+iS"
-# define GLOBAL_ALIAS_MODE "+ioS"
-# define HOSTSERV_ALIAS_MODE "+ioS"
-# define BOTSERV_BOTS_MODE "+qS"
-#endif
+typedef struct ircdvars_ IRCDVar;
+typedef struct ircdcapab_ IRCDCAPAB;
-#ifdef IRC_ULTIMATE3
-# define HAS_HALFOP
-# define HAS_VHOST
-# define HAS_NICKVHOST
-# define HAS_VIDENT /* Can the IRCD Change Idents on the fly */
-# define HAS_EXCEPT
-# define NICKSERV_MODE "+S"
-# define CHANSERV_MODE "+S"
-# define HOSTSERV_MODE "+o"
-# define MEMOSERV_MODE "+S"
-# define BOTSERV_MODE "+S"
-# define HELPSERV_MODE "+Sh"
-# define OPERSERV_MODE "+iS"
-# define DEVNULL_MODE "+iS"
-# define GLOBAL_MODE "+iS"
-# define NICKSERV_ALIAS_MODE "+o"
-# define CHANSERV_ALIAS_MODE "+o"
-# define MEMOSERV_ALIAS_MODE "+o"
-# define BOTSERV_ALIAS_MODE "+o"
-# define HELPSERV_ALIAS_MODE "+h"
-# define OPERSERV_ALIAS_MODE "+io"
-# define DEVNULL_ALIAS_MODE "+i"
-# define GLOBAL_ALIAS_MODE "+io"
-# define HOSTSERV_ALIAS_MODE "+io"
-# define BOTSERV_BOTS_MODE "+S"
-#endif
+struct ircdvars_ {
+ char *name; /* Name of the ChanServ command */
+ char *nickservmode; /* Mode used by NickServ */
+ char *chanservmode; /* Mode used by ChanServ */
+ char *memoservmode; /* Mode used by MemoServ */
+ char *hostservmode; /* Mode used by HostServ */
+ char *operservmode; /* Mode used by OperServ */
+ char *botservmode; /* Mode used by BotServ */
+ char *helpservmode; /* Mode used by HelpServ */
+ char *devnullmode; /* Mode used by Dev/Null */
+ char *globalmode; /* Mode used by Global */
+ char *nickservaliasmode; /* Mode used by NickServ Alias */
+ char *chanservaliasmode; /* Mode used by ChanServ Alias */
+ char *memoservaliasmode; /* Mode used by MemoServ Alias */
+ char *hostservaliasmode; /* Mode used by HostServ Alias */
+ char *operservaliasmode; /* Mode used by OperServ Alias */
+ char *botservaliasmode; /* Mode used by BotServ Alias */
+ char *helpservaliasmode; /* Mode used by HelpServ Alias */
+ char *devnullvaliasmode; /* Mode used by Dev/Null Alias */
+ char *globalaliasmode; /* Mode used by Global Alias */
+ char *botserv_bot_mode; /* Mode used by BotServ Bots */
+ int max_symbols; /* Chan Max Symbols */
+ char *modestoremove; /* Channel Modes to remove */
+ char *botchanumode; /* Modes set when botserv joins a channel */
+ int svsnick; /* Supports SVSNICK */
+ int vhost; /* Supports vhost */
+ int owner; /* Supports Owner */
+ char *ownerset; /* Mode to set for owner */
+ char *ownerunset; /* Mode to unset for a owner */
+ char *modeonreg; /* Mode on Register */
+ char *modeonunreg; /* Mode on Unregister */
+ char *modeonnick; /* Mode on nick change */
+ int sgline; /* Supports SGline */
+ int sqline; /* Supports SQline */
+ int szline; /* Supports SZline */
+ int halfop; /* Supports HalfOp */
+ int numservargs; /* Number of Server Args */
+ int join2set; /* Join 2 Set Modes */
+ int join2msg; /* Join 2 Message */
+ int except; /* exception +e */
+ int topictsforward; /* TS on Topics Forward */
+ int topictsbackward; /* TS on Topics Backward */
+ uint32 protectedumode; /* What is the Protected Umode */
+ int admin; /* Has Admin */
+ int chansqline; /* Supports Channel Sqlines */
+ int quitonkill; /* IRCD sends QUIT when kill */
+ int svsmode_unban; /* svsmode can be used to unban */
+ int protect; /* Has protect modes */
+ int reversekickcheck; /* Can reverse ban check */
+ int chanreg; /* channel mode +r for register */
+ uint32 regmode; /* Mode to use for +r */
+ int vident; /* Supports vidents */
+ int svshold; /* Supports svshold */
+ int tsonmode; /* Timestamp on mode changes */
+ int nickip; /* Sends IP on NICK */
+ int omode; /* On the fly o:lines */
+ int umode; /* change user modes */
+ int nickvhost; /* Users vhost sent during NICK */
+ int chgreal; /* Change RealName */
+ int extrahelp; /* Lang file entry for extra */
+ uint32 noknock; /* Channel Mode for no knock */
+ uint32 adminmode; /* Admin Only Channel Mode */
+ uint32 defmlock; /* Default mlock modes */
+ uint32 vhostmode; /* Vhost mode */
+ int fmode; /* +f */
+ int Lmode; /* +L */
+ uint32 chan_fmode; /* Mode */
+ uint32 chan_lmode; /* Mode */
+ int check_nick_id; /* On nick change check if they could be identified */
+};
-/*
- This gets ugly since serval ircds use both DREAMFORCE and their own define
-*/
-
-#ifdef IRC_DREAMFORGE
- #ifndef NICKSERV_MODE
- # define NICKSERV_MODE "+o"
- #endif
- #ifndef CHANSERV_MODE
- # define CHANSERV_MODE "+o"
- #endif
- #ifndef MEMOSERV_MODE
- # define MEMOSERV_MODE "+o"
- #endif
- #ifndef BOTSERV_MODE
- # define BOTSERV_MODE "+o"
- #endif
- #ifndef HELPSERV_MODE
- # define HELPSERV_MODE "+h"
- #endif
- #ifndef OPERSERV_MODE
- # define OPERSERV_MODE "+io"
- #endif
- #ifndef DEVNULL_MODE
- # define DEVNULL_MODE "+i"
- #endif
- #ifndef GLOBAL_MODE
- # define GLOBAL_MODE "+io"
- #endif
- #ifndef BOTSERV_BOTS_MODE
- # define BOTSERV_BOTS_MODE "+"
- #endif
- #ifndef NICKSERV_ALIAS_MODE
- # define NICKSERV_ALIAS_MODE "+o"
- #endif
- #ifndef CHANSERV_ALIAS_MODE
- # define CHANSERV_ALIAS_MODE "+o"
- #endif
- #ifndef MEMOSERV_ALIAS_MODE
- # define MEMOSERV_ALIAS_MODE "+o"
- #endif
- #ifndef BOTSERV_ALIAS_MODE
- # define BOTSERV_ALIAS_MODE "+o"
- #endif
- #ifndef HELPSERV_ALIAS_MODE
- # define HELPSERV_ALIAS_MODE "+h"
- #endif
- #ifndef OPERSERV_ALIAS_MODE
- # define OPERSERV_ALIAS_MODE "+io"
- #endif
- #ifndef DEVNULL_ALIAS_MODE
- # define DEVNULL_ALIAS_MODE "+i"
- #endif
- #ifndef GLOBAL_ALIAS_MODE
- # define GLOBAL_ALIAS_MODE "+io"
- #endif
-#endif
+struct ircdcapab_ {
+ uint32 noquit;
+ uint32 tsmode;
+ uint32 unconnect;
+ uint32 nickip;
+ uint32 nsjoin;
+ uint32 zip;
+ uint32 burst;
+ uint32 ts5;
+ uint32 ts3;
+ uint32 dkey;
+ uint32 pt4;
+ uint32 scs;
+ uint32 qs;
+ uint32 uid;
+ uint32 knock;
+ uint32 client;
+ uint32 ipv6;
+ uint32 ssj5;
+ uint32 sn2;
+ uint32 token;
+ uint32 vhost;
+ uint32 ssj3;
+ uint32 nick2;
+ uint32 umode2;
+ uint32 vl;
+ uint32 tlkext;
+ uint32 dodkey;
+ uint32 dozip;
+};
/*************************************************************************/
@@ -412,14 +291,15 @@ typedef struct channel_ Channel;
#define PRE_NICK_VERSION 1
#define OPER_VERSION 13
+/*************************************************************************/
+
+
/**
* ModuleData strucs used to allow modules to add / delete module Data from existing structs
*/
-typedef struct ModuleData_ ModuleData; /* ModuleData struct */
-typedef struct ModuleDataItem_ ModuleDataItem; /* A Module Data Item struct */
struct ModuleDataItem_ {
- char *key; /* The key */
+ char *key; /* The key */
char *value; /* The Value */
ModuleDataItem *next; /* The next ModuleDataItem in this list */
};
@@ -430,16 +310,11 @@ struct ModuleData_ {
ModuleData *next; /* The next ModuleData record */
};
-
-
-typedef enum { false, true } boolean;
-
/*************************************************************************/
/* Memo info structures. Since both nicknames and channels can have memos,
* we encapsulate memo data in a MemoList to make it easier to handle. */
-typedef struct memo_ Memo;
struct memo_ {
uint32 number; /* Index number -- not necessarily array position! */
int16 flags;
@@ -449,9 +324,6 @@ struct memo_ {
ModuleData *moduleData[1024]; /* Module saved data attached to the Memo */
};
-#define MF_UNREAD 0x0001 /* Memo has not yet been read */
-#define MF_RECEIPT 0x0002 /* Sender requested receipt */
-
typedef struct {
int16 memocount, memomax;
Memo *memos;
@@ -460,9 +332,7 @@ typedef struct {
/*************************************************************************/
/* NickServ nickname structures. */
-typedef struct nickrequest_ NickRequest;
-typedef struct nickalias_ NickAlias;
-typedef struct nickcore_ NickCore;
+
struct nickrequest_ {
NickRequest *next, *prev;
@@ -470,124 +340,48 @@ struct nickrequest_ {
char *passcode;
char *password;
char *email;
-
time_t requested;
-
time_t lastmail; /* Unsaved */
};
struct nickalias_ {
NickAlias *next, *prev;
-
- char *nick; /* Nickname */
-
- char *last_quit; /* Last quit message */
+ char *nick; /* Nickname */
+ char *last_quit; /* Last quit message */
char *last_realname; /* Last realname */
char *last_usermask; /* Last usermask */
-
- time_t time_registered; /* When the nick was registered */
- time_t last_seen; /* When it was seen online for the last time */
-
- int16 status; /* See NS_* below */
-
- NickCore *nc; /* I'm an alias of this */
-
- /* Not saved */
- ModuleData *moduleData[1024]; /* Module saved data attached to the nick alias */
- User *u; /* Current online user that has me */
+ time_t time_registered; /* When the nick was registered */
+ time_t last_seen; /* When it was seen online for the last time */
+ int16 status; /* See NS_* below */
+ NickCore *nc; /* I'm an alias of this */
+ /* Not saved */
+ ModuleData *moduleData[1024]; /* Module saved data attached to the nick alias */
+ User *u; /* Current online user that has me */
};
struct nickcore_ {
NickCore *next, *prev;
- char *display; /* How the nick is displayed */
- char *pass; /* Password of the nicks */
-
- char *email; /* E-mail associated to the nick */
- char *greet; /* Greet associated to the nick */
- uint32 icq; /* ICQ # associated to the nick */
- char *url; /* URL associated to the nick */
-
- int32 flags; /* See NI_* below */
- uint16 language; /* Language selected by nickname owner (LANG_*) */
-
- int16 accesscount; /* # of entries */
- char **access; /* Array of strings */
-
- MemoInfo memos;
-
- uint16 channelcount; /* Number of channels currently registered */
- uint16 channelmax; /* Maximum number of channels allowed */
-
- /* Unsaved data */
- ModuleData *moduleData[1024]; /* Module saved data attached to the NickCore */
- time_t lastmail; /* Last time this nick record got a mail */
- SList aliases; /* List of aliases */
+ char *display; /* How the nick is displayed */
+ char *pass; /* Password of the nicks */
+ char *email; /* E-mail associated to the nick */
+ char *greet; /* Greet associated to the nick */
+ uint32 icq; /* ICQ # associated to the nick */
+ char *url; /* URL associated to the nick */
+ int32 flags; /* See NI_* below */
+ uint16 language; /* Language selected by nickname owner (LANG_*) */
+ int16 accesscount; /* # of entries */
+ char **access; /* Array of strings */
+ MemoInfo memos;
+ uint16 channelcount; /* Number of channels currently registered */
+ uint16 channelmax; /* Maximum number of channels allowed */
+
+ /* Unsaved data */
+ ModuleData *moduleData[1024]; /* Module saved data attached to the NickCore */
+ time_t lastmail; /* Last time this nick record got a mail */
+ SList aliases; /* List of aliases */
};
-/* Nickname status flags: */
-#define NS_VERBOTEN 0x0002 /* Nick may not be registered or used */
-#define NS_NO_EXPIRE 0x0004 /* Nick never expires */
-#define NS_IDENTIFIED 0x8000 /* User has IDENTIFY'd */
-#define NS_RECOGNIZED 0x4000 /* ON_ACCESS true && SECURE flag not set */
-#define NS_ON_ACCESS 0x2000 /* User comes from a known address */
-#define NS_KILL_HELD 0x1000 /* Nick is being held after a kill */
-#define NS_GUESTED 0x0100 /* SVSNICK has been sent but nick has not
- * yet changed. An enforcer will be
- * introduced when it does change. */
-#define NS_MASTER 0x0200 /* Was a master nick; used to import old databases */
-#define NS_TRANSGROUP 0xC000 /* Status flags that can be passed to a nick of the
- same group during nick change */
-#define NS_TEMPORARY 0xFF00 /* All temporary status flags */
-/* These two are not used anymore */
-#define NS_OLD_ENCRYPTEDPW 0x0001 /* Nickname password is encrypted */
-
-/* Nickname setting flags: */
-#define NI_KILLPROTECT 0x00000001 /* Kill others who take this nick */
-#define NI_SECURE 0x00000002 /* Don't recognize unless IDENTIFY'd */
-#define NI_MSG 0x00000004 /* Use PRIVMSGs instead of NOTICEs */
-#define NI_MEMO_HARDMAX 0x00000008 /* Don't allow user to change memo limit */
-#define NI_MEMO_SIGNON 0x00000010 /* Notify of memos at signon and un-away */
-#define NI_MEMO_RECEIVE 0x00000020 /* Notify of new memos when sent */
-#define NI_PRIVATE 0x00000040 /* Don't show in LIST to non-servadmins */
-#define NI_HIDE_EMAIL 0x00000080 /* Don't show E-mail in INFO */
-#define NI_HIDE_MASK 0x00000100 /* Don't show last seen address in INFO */
-#define NI_HIDE_QUIT 0x00000200 /* Don't show last quit message in INFO */
-#define NI_KILL_QUICK 0x00000400 /* Kill in 20 seconds instead of 60 */
-#define NI_KILL_IMMED 0x00000800 /* Kill immediately instead of in 60 sec */
-#define NI_SERVICES_OPER 0x00001000 /* User is a Services operator */
-#define NI_SERVICES_ADMIN 0x00002000 /* User is a Services admin */
-#define NI_ENCRYPTEDPW 0x00004000 /* Nickname password is encrypted */
-#define NI_SERVICES_ROOT 0x00008000 /* User is a Services root */
-#define NI_MEMO_MAIL 0x00010000 /* User gets email on memo */
-#define NI_HIDE_STATUS 0x00020000 /* Don't show services access status */
-
-/* Languages. Never insert anything in the middle of this list, or
- * everybody will start getting the wrong language! If you want to change
- * the order the languages are displayed in for NickServ HELP SET LANGUAGE,
- * do it in language.c.
- */
-#define LANG_EN_US 0 /* United States English */
-#define LANG_JA_JIS 1 /* Japanese (JIS encoding) */
-#define LANG_JA_EUC 2 /* Japanese (EUC encoding) */
-#define LANG_JA_SJIS 3 /* Japanese (SJIS encoding) */
-#define LANG_ES 4 /* Spanish */
-#define LANG_PT 5 /* Portugese */
-#define LANG_FR 6 /* French */
-#define LANG_TR 7 /* Turkish */
-#define LANG_IT 8 /* Italian */
-#define LANG_DE 9 /* German */
-#define LANG_CAT 10 /* Catalan */
-#define LANG_GR 11 /* Greek */
-#define LANG_NL 12 /* Dutch */
-#define LANG_RU 13 /* Russian */
-#define LANG_HUN 14 /* Hungarian */
-#define LANG_PL 15 /* Polish */
-
-#define NUM_LANGS 16 /* Number of languages */
-#define USED_LANGS 13 /* Number of languages provided */
-
-#define DEF_LANGUAGE LANG_EN_US
/*************************************************************************/
@@ -596,27 +390,21 @@ struct nickcore_ {
* --lara
*/
-typedef struct botinfo_ BotInfo;
-
struct botinfo_ {
-
BotInfo *next, *prev;
char *nick; /* Nickname of the bot */
char *user; /* Its user name */
char *host; /* Its hostname */
char *real; /* Its real name */
-
int16 flags; /* Bot flags -- see BI_* below */
-
time_t created; /* Birth date ;) */
int16 chancount; /* Number of channels that use the bot. */
-
/* Dynamic data */
time_t lastmsg; /* Last time we said something */
};
-#define BI_PRIVATE 0x0001
+
/* Channel info structures. Stored similarly to the nicks, except that
* the second character of the channel name, not the first, is used to
@@ -642,9 +430,7 @@ typedef struct {
/* Levels for xOP */
#define ACCESS_VOP 3
-#ifdef HAS_HALFOP
-# define ACCESS_HOP 4
-#endif
+#define ACCESS_HOP 4
#define ACCESS_AOP 5
#define ACCESS_SOP 10
@@ -667,15 +453,12 @@ typedef struct {
#define AK_USED 0x0001
#define AK_ISNICK 0x0002
-#define AK_STUCK 0x0004
+#define AK_STUCK 0x0004
/* Structure used to contain bad words. */
-typedef struct badword_ BadWord;
-
struct badword_ {
int16 in_use;
-
char *word;
int16 type; /* BW_* below */
};
@@ -685,7 +468,7 @@ struct badword_ {
#define BW_START 2
#define BW_END 3
-typedef struct chaninfo_ ChannelInfo;
+
struct chaninfo_ {
ChannelInfo *next, *prev;
char name[CHANMAX];
@@ -708,7 +491,6 @@ struct chaninfo_ {
char *forbidreason;
int16 bantype;
-
int16 *levels; /* Access levels for commands */
int16 accesscount;
@@ -716,15 +498,11 @@ struct chaninfo_ {
int16 akickcount;
AutoKick *akick; /* List of users to kickban */
- uint32 mlock_on, mlock_off; /* See channel modes below */
+ uint32 mlock_on, mlock_off; /* See channel modes below */
uint32 mlock_limit; /* 0 if no limit */
char *mlock_key; /* NULL if no key */
-#ifdef HAS_FMODE
char *mlock_flood; /* NULL if no +f */
-#endif
-#ifdef HAS_LMODE
char *mlock_redirect; /* NULL if no +L */
-#endif
char *entry_message; /* Notice sent on entering channel */
@@ -793,49 +571,49 @@ struct chaninfo_ {
#define CA_UNBAN 3
#define CA_AUTOOP 4
#define CA_AUTODEOP 5 /* Maximum, not minimum */
-#define CA_AUTOVOICE 6
+#define CA_AUTOVOICE 6
#define CA_OPDEOP 7 /* ChanServ commands OP and DEOP */
-#define CA_ACCESS_LIST 8
+#define CA_ACCESS_LIST 8
#define CA_CLEAR 9
#define CA_NOJOIN 10 /* Maximum */
-#define CA_ACCESS_CHANGE 11
+#define CA_ACCESS_CHANGE 11
#define CA_MEMO 12
-#define CA_ASSIGN 13 /* BotServ ASSIGN command */
-#define CA_BADWORDS 14 /* BotServ BADWORDS command */
-#define CA_NOKICK 15 /* Not kicked by the bot */
-#define CA_FANTASIA 16
+#define CA_ASSIGN 13 /* BotServ ASSIGN command */
+#define CA_BADWORDS 14 /* BotServ BADWORDS command */
+#define CA_NOKICK 15 /* Not kicked by the bot */
+#define CA_FANTASIA 16
#define CA_SAY 17
-#define CA_GREET 18
+#define CA_GREET 18
#define CA_VOICEME 19
#define CA_VOICE 20
-#define CA_GETKEY 21
-#define CA_AUTOHALFOP 22
-#define CA_AUTOPROTECT 23
-#define CA_OPDEOPME 24
-#define CA_HALFOPME 25
-#define CA_HALFOP 26
-#define CA_PROTECTME 27
-#define CA_PROTECT 28
-#define CA_KICKME 29
-#define CA_KICK 30
+#define CA_GETKEY 21
+#define CA_AUTOHALFOP 22
+#define CA_AUTOPROTECT 23
+#define CA_OPDEOPME 24
+#define CA_HALFOPME 25
+#define CA_HALFOP 26
+#define CA_PROTECTME 27
+#define CA_PROTECT 28
+#define CA_KICKME 29
+#define CA_KICK 30
#define CA_SIGNKICK 31
-/* #define CA_AUTOADMIN 32
-#define CA_ADMINME 33
-#define CA_ADMIN 34 */
-#define CA_BANME 32
-#define CA_BAN 33
-#define CA_TOPIC 34
-#define CA_INFO 35
+/* #define CA_AUTOADMIN 32
+#define CA_ADMINME 33
+#define CA_ADMIN 34 */
+#define CA_BANME 32
+#define CA_BAN 33
+#define CA_TOPIC 34
+#define CA_INFO 35
#define CA_SIZE 36
/* BotServ SET flags */
-#define BS_DONTKICKOPS 0x00000001
-#define BS_DONTKICKVOICES 0x00000002
-#define BS_FANTASY 0x00000004
-#define BS_SYMBIOSIS 0x00000008
-#define BS_GREET 0x00000010
-#define BS_NOBOT 0x00000020
+#define BS_DONTKICKOPS 0x00000001
+#define BS_DONTKICKVOICES 0x00000002
+#define BS_FANTASY 0x00000004
+#define BS_SYMBIOSIS 0x00000008
+#define BS_GREET 0x00000010
+#define BS_NOBOT 0x00000020
/* BotServ Kickers flags */
#define BS_KICK_BOLDS 0x80000000
@@ -850,80 +628,41 @@ struct chaninfo_ {
/* Indices for TTB (Times To Ban) */
#define TTB_BOLDS 0
#define TTB_COLORS 1
-#define TTB_REVERSES 2
-#define TTB_UNDERLINES 3
-#define TTB_BADWORDS 4
+#define TTB_REVERSES 2
+#define TTB_UNDERLINES 3
+#define TTB_BADWORDS 4
#define TTB_CAPS 5
#define TTB_FLOOD 6
#define TTB_REPEAT 7
-
#define TTB_SIZE 8
/*************************************************************************/
/* ChanServ mode utilities commands */
-typedef struct csmodeutil_ CSModeUtil;
-
struct csmodeutil_ {
- char *name; /* Name of the ChanServ command */
+ char *name; /* Name of the ChanServ command */
char *bsname; /* Name of the BotServ fantasy command */
-
- char *mode; /* Mode (ie. +o) */
+ char *mode; /* Mode (ie. +o) */
int32 notice; /* Notice flag (for the damn OPNOTICE) */
-
- int level; /* Level required to use the command */
+ int level; /* Level required to use the command */
int levelself; /* Level required to use the command for himself */
};
-#define MUT_DEOP 0
-#define MUT_OP 1
-#define MUT_DEVOICE 2
-#define MUT_VOICE 3
-#ifdef HAS_HALFOP
-#define MUT_DEHALFOP 4
-#define MUT_HALFOP 5
-#endif
-#ifdef IRC_UNREAL
-#define MUT_DEPROTECT 6
-#define MUT_PROTECT 7
-#endif
-#ifdef IRC_ULTIMATE3
-#define MUT_DEPROTECT 6
-#define MUT_PROTECT 7
-#endif
-#ifdef IRC_RAGE2
-#define MUT_DEPROTECT 6
-#define MUT_PROTECT 7
-#endif
-#ifdef IRC_VIAGRA
-#define MUT_DEPROTECT 6
-#define MUT_PROTECT 7
-#endif
-#ifdef IRC_PTLINK
-#define MUT_DEPROTECT 4
-#define MUT_PROTECT 5
-#endif
/*************************************************************************/
-/* Server CAPAB flags */
-#ifdef IRC_BAHAMUT
-# define CAPAB_NOQUIT 0x0001
-# define CAPAB_TSMODE 0x0002
-# define CAPAB_UNCONNECT 0x0004
-#endif
-
/* Server data */
struct server_ {
Server *next, *prev;
- char *name; /* Server name */
- uint16 hops; /* Hops between services and server */
- char *desc; /* Server description */
- uint16 flags; /* Some info flags, as defined below */
+ char *name; /* Server name */
+ uint16 hops; /* Hops between services and server */
+ char *desc; /* Server description */
+ uint16 flags; /* Some info flags, as defined below */
+ char *suid; /* Server Univeral ID */
- Server *links; /* Linked list head for linked servers */
+ Server *links; /* Linked list head for linked servers */
Server *uplink; /* Server which pretends to be the uplink */
};
@@ -938,23 +677,18 @@ struct user_ {
char nick[NICKMAX];
- char *username;
- char *host; /* User's real hostname */
-#ifdef HAS_VHOST
- char *vhost; /* User's virtual hostname */
-#endif
-#ifdef HAS_VIDENT
- char *vident; /* User's virtual ident */
-#endif
- char *realname;
- Server *server; /* Server user is connected to */
-
- char *nickTrack; /* Nick Tracking */
-
- time_t timestamp; /* Timestamp of the nick */
- time_t my_signon; /* When did _we_ see the user? */
- uint32 svid; /* Services ID */
- uint32 mode; /* See below */
+ char *username; /* ident */
+ char *host; /* User's real hostname */
+ char *vhost; /* User's virtual hostname */
+ char *vident; /* User's virtual ident */
+ char *realname; /* Realname */
+ Server *server; /* Server user is connected to */
+ char *nickTrack; /* Nick Tracking */
+ time_t timestamp; /* Timestamp of the nick */
+ time_t my_signon; /* When did _we_ see the user? */
+ uint32 svid; /* Services ID */
+ uint32 mode; /* See below */
+ char *uid; /* Univeral ID */
NickAlias *na;
@@ -981,117 +715,7 @@ struct user_ {
time_t lastmail; /* Last time this user sent a mail */
};
-#define UMODE_a 0x00000001
-#define UMODE_h 0x00000002
-#define UMODE_i 0x00000004
-#define UMODE_o 0x00000008
-#define UMODE_r 0x00000010
-#define UMODE_w 0x00000020
-#define UMODE_A 0x00000040
-
-#ifdef IRC_ULTIMATE
-#define UMODE_p 0x04000000
-#define UMODE_R 0x08000000
-#define UMODE_P 0x20000000
-#endif
-
-#ifdef IRC_ULTIMATE3
-#define UMODE_p 0x04000000
-#define UMODE_Z 0x08000000
-#define UMODE_P 0x20000000
-#endif
-
-#ifdef IRC_DREAMFORGE
-# define UMODE_g 0x80000000
-#endif
-
-#ifdef IRC_BAHAMUT
-# define UMODE_R 0x80000000
-#endif
-
-#ifdef IRC_VIAGRA
-#define UMODE_p 0x04000000
-#endif
-
-#if defined(IRC_ULTIMATE) || defined(IRC_UNREAL) || defined(IRC_ULTIMATE3) || defined(IRC_VIAGRA) || defined(IRC_RAGE2)
-# define UMODE_x 0x40000000
-#endif
-/* Returns *current* user hostname */
-#if defined(IRC_ULTIMATE) || defined(IRC_UNREAL) || defined(IRC_ULTIMATE3) || defined(IRC_VIAGRA) || defined(IRC_RAGE2)
-# define GetHost(x) ((x)->mode & UMODE_x ? (x)->vhost : (x)->host)
-#elif defined(IRC_PTLINK)
-# define GetHost(x) ((x)->mode & UMODE_o ? (x)->vhost ? (x)->vhost : (x)->host : (x)->host)
-#else
-# define GetHost(x) ((x)->host)
-#endif
-
-/* Returns *current* user ident */
-#if defined(IRC_ULTIMATE) || defined(IRC_UNREAL) || defined(IRC_VIAGRA)
-# define GetIdent(x) ((x)->mode & UMODE_x ? (x)->vident ? (x)->vident : (x)->username : (x)->username)
-#else
-# define GetIdent(x) ((x)->username)
-#endif
-
-/* This will introduce a pseudo client with the given nick, username, hostname,
- realname and modes. It will also make a Q line for the nick on demand.
- --lara */
-#if defined(IRC_HYBRID)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", (nick), time(NULL), (modes), \
- (user), (host), ServerName, (real)); \
- } while (0)
-#elif defined(IRC_ULTIMATE3)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "CLIENT %s 1 %ld %s + %s %s * %s 0 0 :%s", (nick), time(NULL), (modes), \
- (user), (host), ServerName, (real)); \
- if ((qline)) send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \
- } while (0)
-#elif defined(IRC_RAGE2)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "SNICK %s %ld 1 %s %s 0 * %s 0 %s :%s", (nick), time(NULL), (user), \
- (host), ServerName, (modes), (real)); \
- if ((qline)) send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \
- } while (0)
-#elif defined(IRC_BAHAMUT) && !defined(IRC_ULTIMATE3) && !defined(IRC_RAGE2)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", (nick), time(NULL), (modes), \
- (user), (host), ServerName, (real)); \
- if ((qline)) send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \
- } while (0)
-#elif defined(IRC_UNREAL)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", (nick), time(NULL), \
- (user), (host), ServerName, (modes), (real)); \
- if ((qline)) send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \
- } while (0)
-#elif defined(IRC_DREAMFORGE)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", (nick), time(NULL), \
- (user), (host), ServerName, (real)); \
- if (strcmp(modes, "+")) send_cmd((nick), "MODE %s %s", (nick), (modes)); \
- if ((qline)) send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \
- } while (0)
-#elif defined(IRC_PTLINK)
-# define NEWNICK(nick,user,host,real,modes,qline) \
- do { \
- send_cmd(NULL, "NICK %s 1 %lu %s %s %s %s %s :%s", (nick), time(NULL), \
- (modes), (user), (host), (host), ServerName, (real)); \
- if ((qline)) send_cmd(NULL, "SQLINE %s :Reserved for services", (nick)); \
- } while (0)
-#endif
-
-typedef struct cbmode_ CBMode;
-typedef struct cbmodeinfo_ CBModeInfo;
-typedef struct cmmode_ CMMode;
-typedef struct csmode_ CSMode;
-typedef struct cumode_ CUMode;
struct cbmode_ {
uint32 flag; /* Long value that represents the mode */
@@ -1104,7 +728,7 @@ struct cbmode_ {
#define CBM_MINUS_NO_ARG 0x0001 /* No argument for unset */
#define CBM_NO_MLOCK 0x0002 /* Can't be MLOCKed */
-#define CBM_NO_USER_MLOCK 0x0004 /* Can't be MLOCKed by non-opers */
+#define CBM_NO_USER_MLOCK 0x0004 /* Can't be MLOCKed by non-opers */
struct cbmodeinfo_ {
char mode; /* The mode */
@@ -1128,80 +752,10 @@ struct cumode_ {
int (*is_valid) (User *user, Channel *chan, int servermode);
};
-/* User flags on channel */
-#define CUS_OP 0x0001
-#define CUS_VOICE 0x0002
-
-#ifdef HAS_HALFOP
-#define CUS_HALFOP 0x0004 /* Halfop (+h) */
-#endif
-
-/* Used by Unreal */
-#ifdef IRC_UNREAL
-#define CUS_OWNER 0x0008 /* Owner/Founder (+q) */
-#define CUS_PROTECT 0x0010 /* Protected users (+a) */
-#endif
-
-/* Used by Viagra */
-#ifdef IRC_VIAGRA
-#define CUS_OWNER 0x0008 /* Owner/Founder (+q) */
-#define CUS_PROTECT 0x0010 /* Protected users (+a) */
-#endif
-
-#ifdef IRC_ULTIMATE3
-#define CUS_PROTECT 0x0010 /* Protected users (+a) */
-#endif
-
-#ifdef IRC_RAGE2
-#define CUS_PROTECT 0x0010 /* Protected users (+a) */
-#endif
-
-/* Used by PTlink */
-#ifdef IRC_PTLINK
-#define CUS_PROTECT 0x0016 /* Protected users (+a) */
-#endif
-
/* Channel user mode flags */
#define CUF_PROTECT_BOTSERV 0x0001
-/* Useful value */
-
-#if defined(IRC_ULTIMATE)
-# define CHAN_MAX_SYMBOLS 3
-#elif defined(IRC_ULTIMATE3)
-# define CHAN_MAX_SYMBOLS 5
-#elif defined(IRC_UNREAL)
-# define CHAN_MAX_SYMBOLS 5
-#elif defined(IRC_RAGE2)
-# define CHAN_MAX_SYMBOLS 3
-#else
-# define CHAN_MAX_SYMBOLS 2
-#endif
-
-/* Binary modes that need to be cleared */
-
-#if defined(IRC_RAGE2)
-#define MODESTOREMOVE "-iklmnpRstcOASCNM"
-#elif defined(IRC_BAHAMUT)
-#define MODESTOREMOVE "-ciklmnpstOR"
-#elif defined(IRC_ULTIMATE)
-#define MODESTOREMOVE "-kiflmnpstxAIKLORS"
-#elif defined(IRC_ULTIMATE3)
-#define MODESTOREMOVE "-iklmnpstRKAO"
-#elif defined(IRC_UNREAL)
-#define MODESTOREMOVE "-ckiflmnpstuzACGHKLNOQRSV"
-#elif defined(IRC_VIAGRA)
-#define MODESTOREMOVE "-ciklmnpstORAH"
-#elif defined(IRC_PTLINK)
-#define MODESTOREMOVE "-cdfiklmnpqstRS"
-#else
-#define MODESTOREMOVE "-iklmnpstR"
-#endif
-
-typedef struct bandata_ BanData;
-typedef struct userdata_ UserData;
-
/* This structure stocks ban data since it must not be removed when
* user is kicked.
*/
@@ -1237,29 +791,18 @@ struct channel_ {
char name[CHANMAX];
ChannelInfo *ci; /* Corresponding ChannelInfo */
time_t creation_time; /* When channel was created */
-
char *topic;
char topic_setter[NICKMAX]; /* Who set the topic */
time_t topic_time; /* When topic was set */
-
- uint32 mode; /* Binary modes only */
+ uint32 mode; /* Binary modes only */
uint32 limit; /* 0 if none */
char *key; /* NULL if none */
-#ifdef HAS_LMODE
- char *redirect; /* +L; NULL if none */
-#endif
-#ifdef HAS_FMODE
- char *flood; /* +f; NULL if none */
-#endif
-
+ char *redirect; /* +L; NULL if none */
+ char *flood; /* +f; NULL if none */
int32 bancount, bansize;
char **bans;
-
-#ifdef HAS_EXCEPT
int32 exceptcount, exceptsize;
char **excepts;
-#endif
-
struct c_userlist {
struct c_userlist *next, *prev;
User *user;
@@ -1276,108 +819,13 @@ struct channel_ {
int16 bouncy_modes; /* Did we fail to set modes here? */
};
-#define CMODE_i 0x00000001
-#define CMODE_m 0x00000002
-#define CMODE_n 0x00000004
-#define CMODE_p 0x00000008
-#define CMODE_s 0x00000010
-#define CMODE_t 0x00000020
-#define CMODE_k 0x00000040 /* These two used only by ChanServ */
-#define CMODE_l 0x00000080
-
-/* The two modes below are for IRC_DREAMFORGE servers only. */
-#ifndef IRC_HYBRID
-#define CMODE_R 0x00000100 /* Only identified users can join */
-#define CMODE_r 0x00000200 /* Set for all registered channels */
-#endif
-
-/* This mode is for IRC_BAHAMUT servers only. */
-#ifdef IRC_BAHAMUT
-#define CMODE_c 0x00000400 /* Colors can't be used */
-#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */
-#define CMODE_O 0x00008000 /* Only opers can join */
-#endif
-
-/* This mode is for IRC_HYBRID servers only. */
-#ifdef IRC_HYBRID
-#define CMODE_a 0x00000400
-#endif
-
-/* These modes are for IRC_ULTIMATE servers only. */
-#ifdef IRC_ULTIMATE
-#define CMODE_f 0x00000400
-#define CMODE_x 0x00000800
-#define CMODE_A 0x00001000
-#define CMODE_I 0x00002000
-#define CMODE_K 0x00004000
-#define CMODE_L 0x00008000
-#define CMODE_O 0x00010000
-#define CMODE_S 0x00020000
-#endif
-
-/* These modes are for IRC_UNREAL servers only. */
-#ifdef IRC_UNREAL
-#define CMODE_c 0x00000400
-#define CMODE_A 0x00000800
-#define CMODE_H 0x00001000
-#define CMODE_K 0x00002000
-#define CMODE_L 0x00004000
-#define CMODE_O 0x00008000
-#define CMODE_Q 0x00010000
-#define CMODE_S 0x00020000
-#define CMODE_V 0x00040000
-#define CMODE_f 0x00080000
-#define CMODE_G 0x00100000
-#define CMODE_C 0x00200000
-#define CMODE_u 0x00400000
-#define CMODE_z 0x00800000
-#define CMODE_N 0x01000000
-#endif
-
-#ifdef IRC_VIAGRA
-#define CMODE_A 0x00001000
-#define CMODE_H 0x00002000
-#endif
-
-/* These modes are for IRC_ULTIMATE3 servers only */
-#ifdef IRC_ULTIMATE3
-#define CMODE_A 0x00000800
-#define CMODE_N 0x00001000
-#define CMODE_S 0x00002000
-#define CMODE_K 0x00004000
-#define CMODE_O 0x00008000
-#endif
-
-/* These modes are for IRC_RAGE2 servers only */
-#ifdef IRC_RAGE2
-#define CMODE_A 0x00000800
-#define CMODE_N 0x00001000
-#define CMODE_S 0x00002000
-#define CMODE_C 0x00004000
-#endif
-
-/* These modes are for IRC_PTLINK servers only. */
-#ifdef IRC_PTLINK
-#define CMODE_A 0x00000400
-#define CMODE_B 0x00000800
-#define CMODE_c 0x00001000
-#define CMODE_d 0x00002000
-#define CMODE_f 0x00004000
-#define CMODE_K 0x00008000
-#define CMODE_O 0x00010000
-#define CMODE_q 0x00020000
-#define CMODE_S 0x00040000
-#define CMODE_N 0x00080000
-#endif
-
-
/*************************************************************************/
/* Constants for news types. */
#define NEWS_LOGON 0
#define NEWS_OPER 1
-#define NEWS_RANDOM 2
+#define NEWS_RANDOM 2
/*************************************************************************/
@@ -1393,8 +841,6 @@ typedef struct ignore_data {
/* Mail data */
-typedef struct mailinfo_ MailInfo;
-
struct mailinfo_ {
FILE *pipe;
User *sender;
@@ -1404,8 +850,6 @@ struct mailinfo_ {
/*************************************************************************/
-typedef struct akill_ Akill;
-
struct akill_ {
char *user; /* User part of the AKILL */
char *host; /* Host part of the AKILL */
@@ -1421,8 +865,6 @@ struct akill_ {
/* Structure for OperServ SGLINE and SZLINE commands */
-typedef struct sxline_ SXLine;
-
struct sxline_ {
char *mask;
char *by;
@@ -1435,8 +877,6 @@ struct sxline_ {
/* Host serv structures */
-typedef struct hostcore_ HostCore;
-
struct hostcore_ {
HostCore *next;
char *nick; /* Owner of the vHost */
@@ -1448,7 +888,7 @@ struct hostcore_ {
/*************************************************************************/
-typedef struct newsitem_ NewsItem;
+
struct newsitem_ {
int16 type;
@@ -1460,7 +900,7 @@ struct newsitem_ {
/*************************************************************************/
-typedef struct exception_ Exception;
+
struct exception_ {
char *mask; /* Hosts to which this exception applies */
int limit; /* Session limit for exception */
@@ -1478,7 +918,7 @@ struct exception_ {
/* Proxy stuff */
-typedef struct hostcache_ HostCache;
+
struct hostcache_ {
HostCache *prev, *next;
@@ -1515,6 +955,127 @@ struct hostcache_ {
#define DEFCON_SILENT_OPER_ONLY 128 /* Silently ignore non-opers */
#define DEFCON_AKILL_NEW_CLIENTS 256 /* AKILL any new clients */
#define DEFCON_NO_NEW_MEMOS 512 /* No New Memos Sent */
+
+/*************************************************************************/
+
+/* Memo Flags */
+#define MF_UNREAD 0x0001 /* Memo has not yet been read */
+#define MF_RECEIPT 0x0002 /* Sender requested receipt */
+
+
+/* Nickname status flags: */
+#define NS_VERBOTEN 0x0002 /* Nick may not be registered or used */
+#define NS_NO_EXPIRE 0x0004 /* Nick never expires */
+#define NS_IDENTIFIED 0x8000 /* User has IDENTIFY'd */
+#define NS_RECOGNIZED 0x4000 /* ON_ACCESS true && SECURE flag not set */
+#define NS_ON_ACCESS 0x2000 /* User comes from a known address */
+#define NS_KILL_HELD 0x1000 /* Nick is being held after a kill */
+#define NS_GUESTED 0x0100 /* SVSNICK has been sent but nick has not
+ * yet changed. An enforcer will be
+ * introduced when it does change. */
+#define NS_MASTER 0x0200 /* Was a master nick; used to import old databases */
+#define NS_TRANSGROUP 0xC000 /* Status flags that can be passed to a nick of the
+ same group during nick change */
+#define NS_TEMPORARY 0xFF00 /* All temporary status flags */
+/* These two are not used anymore */
+#define NS_OLD_ENCRYPTEDPW 0x0001 /* Nickname password is encrypted */
+
+/* Nickname setting flags: */
+#define NI_KILLPROTECT 0x00000001 /* Kill others who take this nick */
+#define NI_SECURE 0x00000002 /* Don't recognize unless IDENTIFY'd */
+#define NI_MSG 0x00000004 /* Use PRIVMSGs instead of NOTICEs */
+#define NI_MEMO_HARDMAX 0x00000008 /* Don't allow user to change memo limit */
+#define NI_MEMO_SIGNON 0x00000010 /* Notify of memos at signon and un-away */
+#define NI_MEMO_RECEIVE 0x00000020 /* Notify of new memos when sent */
+#define NI_PRIVATE 0x00000040 /* Don't show in LIST to non-servadmins */
+#define NI_HIDE_EMAIL 0x00000080 /* Don't show E-mail in INFO */
+#define NI_HIDE_MASK 0x00000100 /* Don't show last seen address in INFO */
+#define NI_HIDE_QUIT 0x00000200 /* Don't show last quit message in INFO */
+#define NI_KILL_QUICK 0x00000400 /* Kill in 20 seconds instead of 60 */
+#define NI_KILL_IMMED 0x00000800 /* Kill immediately instead of in 60 sec */
+#define NI_SERVICES_OPER 0x00001000 /* User is a Services operator */
+#define NI_SERVICES_ADMIN 0x00002000 /* User is a Services admin */
+#define NI_ENCRYPTEDPW 0x00004000 /* Nickname password is encrypted */
+#define NI_SERVICES_ROOT 0x00008000 /* User is a Services root */
+#define NI_MEMO_MAIL 0x00010000 /* User gets email on memo */
+#define NI_HIDE_STATUS 0x00020000 /* Don't show services access status */
+
+/* Languages. Never insert anything in the middle of this list, or
+ * everybody will start getting the wrong language! If you want to change
+ * the order the languages are displayed in for NickServ HELP SET LANGUAGE,
+ * do it in language.c.
+ */
+#define LANG_EN_US 0 /* United States English */
+#define LANG_JA_JIS 1 /* Japanese (JIS encoding) */
+#define LANG_JA_EUC 2 /* Japanese (EUC encoding) */
+#define LANG_JA_SJIS 3 /* Japanese (SJIS encoding) */
+#define LANG_ES 4 /* Spanish */
+#define LANG_PT 5 /* Portugese */
+#define LANG_FR 6 /* French */
+#define LANG_TR 7 /* Turkish */
+#define LANG_IT 8 /* Italian */
+#define LANG_DE 9 /* German */
+#define LANG_CAT 10 /* Catalan */
+#define LANG_GR 11 /* Greek */
+#define LANG_NL 12 /* Dutch */
+#define LANG_RU 13 /* Russian */
+#define LANG_HUN 14 /* Hungarian */
+#define LANG_PL 15 /* Polish */
+
+#define NUM_LANGS 16 /* Number of languages */
+#define USED_LANGS 13 /* Number of languages provided */
+
+
+#define DEF_LANGUAGE LANG_EN_US
+
+#define BI_PRIVATE 0x0001
+
+#define CUS_OP 0x0001
+#define CUS_VOICE 0x0002
+#define CUS_HALFOP 0x0004 /* Halfop (+h) */
+#define CUS_OWNER 0x0008 /* Owner/Founder (+q) */
+#define CUS_PROTECT 0x0010 /* Protected users (+a) */
+
+#define MUT_DEOP 0
+#define MUT_OP 1
+#define MUT_DEVOICE 2
+#define MUT_VOICE 3
+#define MUT_DEHALFOP 4
+#define MUT_HALFOP 5
+#define MUT_DEPROTECT 6
+#define MUT_PROTECT 7
+
+
+#define CAPAB_NOQUIT 0x00000001
+#define CAPAB_TSMODE 0x00000002
+#define CAPAB_UNCONNECT 0x00000004
+#define CAPAB_NICKIP 0x00000008
+#define CAPAB_NSJOIN 0x00000010
+#define CAPAB_ZIP 0x00000020
+#define CAPAB_BURST 0x00000040
+#define CAPAB_TS3 0x00000080
+#define CAPAB_TS5 0x00000100
+#define CAPAB_DKEY 0x00000200
+#define CAPAB_DOZIP 0x00000400
+#define CAPAB_DODKEY 0x00000800
+#define CAPAB_QS 0x00001000
+#define CAPAB_SCS 0x00002000
+#define CAPAB_PT4 0x00004000
+#define CAPAB_UID 0x00008000
+#define CAPAB_KNOCK 0x00010000
+#define CAPAB_CLIENT 0x00020000
+#define CAPAB_IPV6 0x00040000
+#define CAPAB_SSJ5 0x00080000
+#define CAPAB_SN2 0x00100000
+#define CAPAB_VHOST 0x00200000
+#define CAPAB_TOKEN 0x00400000
+#define CAPAB_SSJ3 0x00800000
+#define CAPAB_NICK2 0x01000000
+#define CAPAB_UMODE2 0x02000000
+#define CAPAB_VL 0x04000000
+#define CAPAB_TLKEXT 0x08000000
+
+
/*************************************************************************/
#include "extern.h"
diff --git a/include/sysconf.h.in b/include/sysconf.h.in
index 2b5108676..326501c5e 100644
--- a/include/sysconf.h.in
+++ b/include/sysconf.h.in
@@ -109,13 +109,16 @@
#undef IRC_RAGE2
/* "Second IRCD type" */
-#undef IRC_ULTIMATE
+#undef IRC_ULTIMATE2
/* "Second IRCD type" */
#undef IRC_ULTIMATE3
/* "Second IRCD type" */
-#undef IRC_UNREAL
+#undef IRC_UNREAL31
+
+/* "Second IRCD type" */
+#undef IRC_UNREAL32
/* "Second IRCD type" */
#undef IRC_VIAGRA
diff --git a/include/ultimate2.h b/include/ultimate2.h
new file mode 100644
index 000000000..4cbd2c363
--- /dev/null
+++ b/include/ultimate2.h
@@ -0,0 +1,63 @@
+/* Ultimate IRCD 2 functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_ULTIMATE2
+
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_p 0x04000000
+#define UMODE_R 0x08000000
+#define UMODE_P 0x20000000
+#define UMODE_g 0x80000000
+#define UMODE_x 0x40000000
+
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_f 0x00000400
+#define CMODE_x 0x00000800
+#define CMODE_A 0x00001000
+#define CMODE_I 0x00002000
+#define CMODE_K 0x00004000
+#define CMODE_L 0x00008000
+#define CMODE_O 0x00010000
+#define CMODE_S 0x00020000
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+
+
diff --git a/include/ultimate3.h b/include/ultimate3.h
new file mode 100644
index 000000000..b654e8f08
--- /dev/null
+++ b/include/ultimate3.h
@@ -0,0 +1,60 @@
+/* Ultimate IRCD 3.0 functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_ULTIMATE3
+
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define FANT_PROTECT_ADD "!admin"
+#define FANT_PROTECT_DEL "!deadmin"
+#define LEVEL_PROTECT_WORD "AUTOADMIN"
+#define LEVELINFO_PROTECT_WORD "ADMIN"
+#define LEVELINFO_PROTECTME_WORD "ADMINME"
+#define CS_CMD_PROTECT "ADMIN"
+#define CS_CMD_DEPROTECT "DEADMIN"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_p 0x04000000
+#define UMODE_Z 0x08000000
+#define UMODE_P 0x20000000
+#define UMODE_R 0x80000000
+#define UMODE_x 0x40000000
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_A 0x00000800
+#define CMODE_N 0x00001000
+#define CMODE_S 0x00002000
+#define CMODE_K 0x00004000
+#define CMODE_c 0x00000400 /* Colors can't be used */
+#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */
+#define CMODE_O 0x00008000 /* Only opers can join */
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+
diff --git a/include/unreal31.h b/include/unreal31.h
new file mode 100644
index 000000000..40766af30
--- /dev/null
+++ b/include/unreal31.h
@@ -0,0 +1,66 @@
+/* Unreal IRCD 3.1.x functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+/*************************************************************************/
+
+#ifdef IRC_UNREAL31
+
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_g 0x80000000
+#define UMODE_x 0x40000000
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_c 0x00000400
+#define CMODE_A 0x00000800
+#define CMODE_H 0x00001000
+#define CMODE_K 0x00002000
+#define CMODE_L 0x00004000
+#define CMODE_O 0x00008000
+#define CMODE_Q 0x00010000
+#define CMODE_S 0x00020000
+#define CMODE_V 0x00040000
+#define CMODE_f 0x00080000
+#define CMODE_G 0x00100000
+#define CMODE_C 0x00200000
+#define CMODE_u 0x00400000
+#define CMODE_z 0x00800000
+#define CMODE_N 0x01000000
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
diff --git a/include/unreal32.h b/include/unreal32.h
new file mode 100644
index 000000000..02df21643
--- /dev/null
+++ b/include/unreal32.h
@@ -0,0 +1,80 @@
+/* Unreal IRCD 3.2.x functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_UNREAL32
+
+/*************************************************************************/
+
+/* User Modes */
+#define UMODE_a 0x00000001
+#define UMODE_h 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_r 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_A 0x00000040
+#define UMODE_g 0x80000000
+#define UMODE_x 0x40000000
+#define UMODE_R 0x80000000
+
+/*************************************************************************/
+
+/* Channel Modes */
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040 /* These two used only by ChanServ */
+#define CMODE_l 0x00000080
+#define CMODE_c 0x00000400
+#define CMODE_A 0x00000800
+#define CMODE_H 0x00001000
+#define CMODE_K 0x00002000
+#define CMODE_L 0x00004000
+#define CMODE_O 0x00008000
+#define CMODE_Q 0x00010000
+#define CMODE_S 0x00020000
+#define CMODE_V 0x00040000
+#define CMODE_f 0x00080000
+#define CMODE_G 0x00100000
+#define CMODE_C 0x00200000
+#define CMODE_u 0x00400000
+#define CMODE_z 0x00800000
+#define CMODE_N 0x01000000
+#define CMODE_R 0x00000100 /* Only identified users can join */
+#define CMODE_r 0x00000200 /* Set for all registered channels */
+
+/*************************************************************************/
+
+/* Since we differ !protect from !admin we need to know what to use */
+
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+
+/*************************************************************************/
+
+/* Default Modes with MLOCK */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
diff --git a/include/version.sh b/include/version.sh
index 6f5cad192..2ff3bb5a3 100644
--- a/include/version.sh
+++ b/include/version.sh
@@ -50,40 +50,6 @@ const char version_number[] = "$VERSION";
const char version_build[] =
"build #" BUILD ", compiled " __DATE__ " " __TIME__;
-const char version_protocol[] =
-#if defined(IRC_ULTIMATE3)
- "UltimateIRCd 3.0.0.a26+"
-# define VER_IRCD "UltimateIRCd 3.0.* -"
-#elif defined(IRC_VIAGRA)
- "ViagraIRCd 1.3.x"
-# define VER_IRCD "ViagraIRCd 1.3.* -"
-#elif defined(IRC_RAGE2)
- "RageIRCd 2.0.x"
-# define VER_IRCD "RageIRCd 2.0.* -"
-#elif defined(IRC_BAHAMUT)
- "Bahamut 1.4.27+"
-# define VER_IRCD "BahamutIRCd 1.4.*/1.8.* -"
-#elif defined(IRC_ULTIMATE)
- "UltimateIRCd 2.8.2+"
-# define VER_IRCD "UltimateIRCd 2.8.* -"
-#elif defined(IRC_UNREAL)
- "UnrealIRCd 3.1.1+"
-# define VER_IRCD "UnrealIRCd -"
-#elif defined(IRC_DREAMFORGE)
- "DreamForge 4.6.7"
-# define VER_IRCD "DreamForgeIRCd 4.6.7 -"
-#elif defined(IRC_HYBRID)
- "Hybrid IRCd 7.0"
-# define VER_IRCD "HybridIRCd 7.* -"
-#elif defined(IRC_PTLINK)
- "PTlink 6.14.5+"
-# define VER_IRCD "PTlinkIRCd 6.14.* -"
-#else
- "unknown"
-# define VER_IRCD
-#endif
- ;
-
#ifdef DEBUG_COMMANDS
# define VER_DEBUG "D"
#else
@@ -140,7 +106,8 @@ const char version_protocol[] =
# define VER_MODULE
#endif
-const char version_flags[] = VER_IRCD VER_DEBUG VER_ENCRYPTION VER_THREAD VER_OS VER_GHBNR VER_MYSQL VER_MODULE;
+/* the space is needed cause if you build with nothing it will complain */
+const char version_flags[] = " " VER_DEBUG VER_ENCRYPTION VER_THREAD VER_OS VER_GHBNR VER_MYSQL VER_MODULE;
EOF
diff --git a/include/viagra.h b/include/viagra.h
new file mode 100644
index 000000000..44fd9166b
--- /dev/null
+++ b/include/viagra.h
@@ -0,0 +1,76 @@
+/* Viagra IRCD functions
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifdef IRC_VIAGRA
+
+#define PROTECT_SET_MODE "+a"
+#define PROTECT_UNSET_MODE "+a"
+#define CS_CMD_PROTECT "PROTECT"
+#define CS_CMD_DEPROTECT "DEPROTECT"
+#define FANT_PROTECT_ADD "!protect"
+#define FANT_PROTECT_DEL "!deprotect"
+#define LEVEL_PROTECT_WORD "AUTOPROTECT"
+#define LEVELINFO_PROTECT_WORD "PROTECT"
+#define LEVELINFO_PROTECTME_WORD "PROTECTME"
+
+/* User Modes */
+#define UMODE_A 0x00000040 /* Is a Server Administrator. */
+#define UMODE_C 0x00002000 /* Is a Server Co Administrator. */
+#define UMODE_I 0x00008000 /* Stealth mode, makes you beeing hidden at channel. invisible joins/parts. */
+#define UMODE_N 0x00000400 /* Is a Network Administrator. */
+#define UMODE_O 0x00004000 /* Local IRC Operator. */
+#define UMODE_Q 0x00001000 /* Is an Abuse Administrator. */
+#define UMODE_R 0x08000000 /* Cant receive messages from non registered user. */
+#define UMODE_S 0x00000080 /* Is a Network Service. For Services only. */
+#define UMODE_T 0x00000800 /* Is a Technical Administrator. */
+#define UMODE_a 0x00000001 /* Is a Services Administrator. */
+#define UMODE_b 0x00040000 /* Can listen to generic bot warnings. */
+#define UMODE_c 0x00010000 /* See's all connects/disconnects on local server. */
+#define UMODE_d 0x00000100 /* Can listen to debug and channel cration notices. */
+#define UMODE_e 0x00080000 /* Can see client connections/exits on remote servers. */
+#define UMODE_f 0x00100000 /* Listen to flood/spam alerts from server. */
+#define UMODE_g 0x00000200 /* Can read & send to globops, and locops. */
+#define UMODE_h 0x00000002 /* Is a Help Operator. */
+#define UMODE_i 0x00000004 /* Invisible (Not shown in /who and /names searches). */
+#define UMODE_n 0x00020000 /* Can see client nick change notices. */
+#define UMODE_o 0x00000008 /* Global IRC Operator. */
+#define UMODE_r 0x00000010 /* Identifies the nick as being registered. */
+#define UMODE_s 0x00200000 /* Can listen to generic server messages. */
+#define UMODE_w 0x00000020 /* Can listen to wallop messages. */
+#define UMODE_x 0x40000000 /* Gives the user hidden hostname. */
+
+
+/* Channel Modes */
+#define CMODE_i 0x00000001 /* Invite-only allowed. */
+#define CMODE_m 0x00000002 /* Moderated channel, noone can speak and changing nick except users with mode +vho */
+#define CMODE_n 0x00000004 /* No messages from outside channel */
+#define CMODE_p 0x00000008 /* Private channel. */
+#define CMODE_s 0x00000010 /* Secret channel. */
+#define CMODE_t 0x00000020 /* Only channel operators may set the topic */
+#define CMODE_k 0x00000040 /* Needs the channel key to join the channel */
+#define CMODE_l 0x00000080 /* Channel may hold at most <number> of users */
+#define CMODE_R 0x00000100 /* Requires a registered nickname to join the channel. */
+#define CMODE_r 0x00000200 /* Channel is registered. */
+#define CMODE_c 0x00000400 /* No ANSI color can be sent to the channel */
+#define CMODE_M 0x00000800 /* Requires a registered nickname to speak at the channel. */
+#define CMODE_H 0x00001000 /* HelpOps only channel. */
+#define CMODE_O 0x00008000 /* IRCOps only channel. */
+#define CMODE_S 0x00020000 /* Strips all mesages out of colors. */
+#define CMODE_N 0x01000000 /* No nickchanges allowed. */
+#define CMODE_P 0x02000000 /* "Peace mode" No kicks allowed unless by u:lines */
+#define CMODE_x 0x04000000 /* No bold/underlined or reversed text can be sent to the channel */
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
+
+#endif
+