1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 19:03:14 +02:00

BUILD : 1.7.7 (555) BUGS : N/A NOTES : TS6 support, Ratbox support, lots of little bug fixes, updated documentation

git-svn-id: svn://svn.anope.org/anope/trunk@555 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@408 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b
2005-01-23 07:32:56 +00:00
parent ba7b29bba7
commit 01f32cf288
38 changed files with 2982 additions and 369 deletions
+10
View File
@@ -1,9 +1,19 @@
Anope Version S V N
-------------------
Provided by Anope Dev. <dev@anope.org> - 2005
01/23 A Support for Ratbox IRCD (With and Without TS6) [ #00]
01/23 A Support for TS6 protocol [ #00]
01/19 A Add simple smtp client, read the README in src/tools for info [ #00]
01/16 A Support for PTlinks VHOST (NEWMASK) command. [ #00]
01/16 A Ulines Servers are now except from NOJOIN bans [#281]
01/23 F Fixed u_char warnings under OpenBSD. [ #00]
01/23 F anope_cmd_ctcp() fixed it was setup wrong. [ #00]
01/23 F Checks to make sure Services and Services Alias are not the same [ #00]
01/23 F SIGINT now shuts down Anope correctly when running with -nofork [ #00]
01/23 F Attempting to set +h (helper) modes on ircd where there is no +h [ #00]
01/23 F Fixed problem when dealing with non-existant user privmsg [ #00]
01/23 F Updated IRCD, FAQ, README to be more current [ #00]
01/23 F Free's memory on shutdown that is in the User and Channel structs [ #00]
01/20 F Misplaced MEMO_NO_RSEND_SELF in es.l reordered. [ #00]
01/19 F OperServ HELP does not show commands not usable on that ircd [ #25]
01/16 F Help messages restricted to the right access level. [#272]
+8
View File
@@ -2,6 +2,14 @@ Anope Version S V N
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# UseTS6 [OPTIONAL]
#
# Modern hybrid ircd like Ratbox 2.0.x support a protocol called TS6.
# However this protocol is optional thus our default support is for without
# TS6, if you want to take advantage of TS6, enable this option.
#UseTS6
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
+5
View File
@@ -224,6 +224,7 @@ echo " 9) RageIRCd 2.0.0 [beta-6 or later]"
echo " 10) Unreal 3.2 [Unreal 3.2 beta19 or later]"
echo " 11) Solid IRCD 3.4.x [Solid IRCD 3.4.6 or later]"
echo " 12) Plexus 2.0 [or later]"
echo " 13) Ratbox 2.0.6 [or later]"
while [ $ok -eq 0 ] ; do
echo2 "[$IRCTYPE] "
@@ -286,6 +287,10 @@ while [ $ok -eq 0 ] ; do
IRCTYPE_DEF="IRC_PLEXUS"
ok=1;
;;
13)
IRCTYPE_DEF="IRC_RATBOX"
ok=1;
;;
*)
echo "Please enter a valid option number."
Vendored
+9
View File
@@ -4557,6 +4557,7 @@ esac
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_pic" >&5
echo "${ECHO_T}$ac_cv_pic" >&6
@@ -8609,6 +8610,14 @@ _ACEOF
IRCDFILE=" plexus.c "
elif test "$withval" = "IRC_RATBOX"; then
cat >>confdefs.h <<\_ACEOF
#define IRC_RATBOX 1
_ACEOF
IRCDFILE=" ratbox.c "
fi
+5
View File
@@ -114,6 +114,7 @@ case `uname -s` in
esac
fi
])
AC_CACHE_CHECK(if your system prepends an underscore on symbols,ac_cv_underscore,[
cat >uscore.c << __EOF__
@@ -241,6 +242,10 @@ AC_ARG_WITH(ircd, [ --with-ircd=ircd Specify the first ircd type], [
AC_DEFINE(IRC_PLEXUS,1,"First IRCD type")
IRCDFILE=" plexus.c "
AC_SUBST(IRCDFILE)
elif test "$withval" = "IRC_RATBOX"; then
AC_DEFINE(IRC_RATBOX,1,"First IRCD type")
IRCDFILE=" ratbox.c "
AC_SUBST(IRCDFILE)
fi
])
+10
View File
@@ -240,6 +240,8 @@ NetworkName "LocalNet"
# Numeric [OPTIONAL]
# Many ircd identify themselves with a Numeric ID when using this option
# consult your ircds documentation before using this
# - With TS6 ircd this must be 2 numbers, Anope will append X to this to
# make the numeric ##X
#Numeric 0
###########################################################################
@@ -480,6 +482,14 @@ GlobalOnCycleUP "Services are now back online - have a nice day"
UlineServers "stats.your.network proxy.your.network"
# UseTS6 [OPTIONAL]
#
# Modern hybrid ircd like Ratbox 2.0.x support a protocol called TS6.
# However this protocol is optional thus our default support is for without
# TS6, if you want to take advantage of TS6, enable this option.
#UseTS6
###########################################################################
#
# Mail-related options
+11 -14
View File
@@ -92,6 +92,8 @@ Index:
33. What is a Super-Admin? How does it work? Why might it not work?
34. How to auto voice all those whom join my #channel?
---------------------------------------------------------------------------
1. What is Anope?
@@ -114,20 +116,9 @@ Index:
3. Does Anope run under Windows?
Well... not officially. Bu there is a cygwin based patch that makes
Anope work on Windows. Note, however, that some features might not
work, and you should take that into consideration when answering
the questions of ./configure (i.e. MySQL, Modules).
You can obtain a pre-build copy of Anope for Windows from
http://www.wircds.net/ although we have "blessed" that port,
we do not provide support for it. If you can't get it work,
go to wIRCds.net forum.
If you feel capable of taking ownership of an official windows
port, and to keep it current, please let the current Development
team know.
Well... not officially. Bu there is a port branch of services that will
work on Windows. Visit http://windows.anope.org for more information on
this port.
4. Can I send you questions without reading the FAQ, INSTALL or README
files?
@@ -421,3 +412,9 @@ Index:
It only works if SuperAdmin is uncommented in the services
configuration file. This is commented by default.
Read /msg OperServ HELP SET SUPERADMIN for further help.
34. How to auto voice all those whom join my #channel?
/cs set #channel secure off
/cs set #channel xop off
/cs levels #channel set AUTOVOICE -1
+156 -44
View File
@@ -1,9 +1,12 @@
HOW TO ADD IRCD SUPPORT
1. Files to edit
2. Structure
3. Functions / Events
4. CAPAB/PROTOCTL
2. Modifing the header file
3. The code
4. Functions / Events
5. CAPAB/PROTOCTL
=============================================================================================
1. FILES TO EDIT
@@ -12,14 +15,123 @@ following files.
A. Make a copy of the .c and .h file of the IRCD that closely matches the ircd
that you are attempting to add support for.
B. Make a backup copy of services.h
C. Make a backup copy of Config, and src/Makefile
B. Make a backup copy of include/services.h, include/sysconf.h.in
C. Make a backup copy of Config and configure.in
First step in this process is to rename the .c and .h file after the IRCD that you are going
to be adding support for. Its recommened that you come up with a name that is clear and easy
to understand.
2. STRUCTURE
To allow for easy code change to support your ircd. There are two structs that
make up the simplest variables to allow you to quickly change out your ircd
without much work.
Now that you have the files that you will need to create your own ircd support. Starting with
Config, this file is a shell script file, scroll down till you find the list of ircds for the
user to select. Indicate the based ircd version which is supported such as a series 1.x or 2.2.x,
placing in the comment side an exact version that the support is for or "experimental" if you
are not the ircd developer. The next step is to decide how the IRCD will be defined, following
the existing examples edit " IRCTYPE_DEF="IRC_RATBOX" " to be the descriptive define for your
ircd.
With the Config file ready to go, edit configure.in and find in there the reference to
--with-ircd, you should see see the various other ircd, and you will want to add yours in there
using the same IRC_ name you came up with above. Important in this step is to make sure that you
set the IRCDFILE to the name of the .c file you set in step 1. Once you have the configure.in
created you can remove the old configure and at the command prompt type "autconf", this will
generate the configure file.
Getting close to actually modify code. Open sysconf.h.in and add two lines for your given ircd
which is similar to this
/* "First IRCD type" */
#undef IRC_RATBOX
Open services.h and add a line with the rest of the ircd include files to match the name of the
.h file you set in step 1.
#include "ratbox.h"
Taking the .c and .h file open them and replace the #ifdef IRC_* with the IRC_ name you set in
step two. Ensure that the code comments at the top of the file match the ircd that the code
will be for.
You are now ready to start getting into the code.
=============================================================================================
2. Modifing the header file
Now that you have gotten past the first part of the creation process. You are into the code
this part is the harder and more complex part. You will need a general understanding of C
code to continue. Here are the step by step instructions required to make this work.
Open the .h file and find the section of code with
#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"
If the ircd supports a protective/admin (not owner) mode, set the PROTECT_SET_MODE and
PROTECT_UNSET_MODE to be that mode. On most ircd its the mode of "a" so you setting it
to "+a" and "-a". The next to are based more on what this mode is called, when you
message ChanServ to get this mode, this is the command you will be using. Following
that comes the fantasy commands which can be used in channel to get these modes. The next
three relate to the ACCESS LEVEL list system, again these are the words to gain these
levels in the ACCESS LEVEL system. If your ircd does not have these functions, leave
them at what ever value is currently set, the core code will handle ignore the request
of the user.
Now that this is set, you can define the MODES, all user modes are stored with UMODE_
followed by a letter matching the modes case, be careful to use the correct case as this
will make it clear when you setup MODES in the .c in a few. Use hex values for the modes
so starting at 0x00000001 to 0x8000000, in most cases you want to list all modes. If you
run out of values look at removing any modes that do not impact services.
Channel modes are done much like user modes, with the exception that, bans, exceptions,
invites, and modes that are applied to a user such as op, voice are not defined here. All
other modes are defined in here. Again be clear and use the correct case and use hex values
as done with user modes.
Finally we come to DEFAULT_MLOCK, this is the mode that services will set by default on channels
when they are registered. In general you want this to be whats acceptable by the ircd, in most
cause this is "+nt"
=============================================================================================
3. The Code
Here is where the code of the .c file comes in. be prepared to spend at least an hour if
not longer going over the code and getting it right especially if you are setting up an ircd
that is completely different then that which your adding support for. This section goes over
the majority of the code that is in use.
First bit of code you will face is
const char version_protocol[] = "Ratbox IRCD";
This the protocol name which will appear in various places especially when you do -version
at the command prompt, this where you state the server name, the version is not always needed
unless you are showing that the support is for one branch of a ircd family, such as Unreal 3.1
and Unreal 3.2
Once you have decided on this little piece of code, you will come to flood mode characters
being used for setting and removing. If your IRCD does not support flood modes, you can just
use "", we will be setting if your IRCD supports flooding in a little bit.
const char flood_mode_char_set[] = "+f";
const char flood_mode_char_remove[] = "-f";
The next task that you will face is setting whether the IRCD sends time stamps on modes but
does not tell us that it will do so. If it does set UseTSMODE to 1, if it does not set it to be 0,
if your not sure refer to your IRCD's documentation on how MODE is sent
int UseTSMODE = 0;
Now you come to the part where you setup your ircd, there are two struct which hold this
information. This allows you to quickly setup your specific ircd.
IRCDVar ircd[] = { }
@@ -214,15 +326,47 @@ usage of each.
77. SGline Enforce : the ircd enforces sglines for us we don't need to, 1 = yes 0 = no
IRCDCAPAB ircdcap[] = { }
This struct is based of the CAPAB defines, you should review the the CAPAB table
below for how this to be done.
Define Table
======================================================================================================
DEFINE WORD | VALUE | TOKEN | IRCD Meaning
======================================================================================================
CAPAB_NOQUIT | 0x00000001 | NOQUIT | Supports NOQUIT
CAPAB_TSMODE | 0x00000002 | TS | Channel modes are TimeStamped (normal sent during PASS)
CAPAB_UNCONNECT | 0x00000004 | UNCONNECT | Supports UNCONNECT
CAPAB_NICKIP | 0x00000008 | NICKIP | IP in the NICK line
CAPAB_NSJOIN | 0x00000010 | SSJOIN | smart sjoin SSJOIN
CAPAB_ZIP | 0x00000020 | ZIP | server supports gz'd links
CAPAB_BURST | 0x00000040 | BURST | server supports BURST command
CAPAB_TS3 | 0x00000080 | TS3 | Supports the TS3 Protocol
CAPAB_TS5 | 0x00000100 | TS5 | Supports the TS5 Protocol
CAPAB_DKEY | 0x00000200 | DKEY | server supports dh-key exchange using "DKEY"
CAPAB_DOZIP | 0x00000400 | ZIP | output to this link shall be gzipped
CAPAB_DODKEY | 0x00000800 | DKEY | do I do dkey with this link?
CAPAB_QS | 0x00001000 | QS | Can handle quit storm removal
CAPAB_SCS | 0x00002000 | SCS | Supports String Cache System
CAPAB_PT4 | 0x00004000 | PT4 | PT4 Protocol Support
CAPAB_UID | 0x00008000 | UID | Can do UIDs
CAPAB_KNOCK | 0x00010000 | KNOCK | supports KNOCK
CAPAB_CLIENT | 0x00020000 | CLIENT | Supports CLIENT
CAPAB_IPV6 | 0x00040000 | IPV6 | Server is able to handle ipv6 address masks
CAPAB_SSJ5 | 0x00080000 | SSJ5 | Server supports smart join protocol 5
CAPAB_SN2 | 0x00100000 | SN2 | Supports SN2 protocol (SNICK 2)
CAPAB_VHOST | 0x00200000 | VHOST | Supports VHOST protocol
CAPAB_TOKEN | 0x00400000 | TOKEN | Supports tokenized server<->server commands
CAPAB_SSJ3 | 0x00800000 | SSJ3 | Server supports smart join protocol 3
CAPAB_NICK2 | 0x01000000 | NICK2 | supports the extended NICK command (version 2)
CAPAB_UMODE2 | 0x02000000 | UMODE2 | support for the UMODE2 command
CAPAB_VL | 0x04000000 | VL | Vline information is included in the info field
CAPAB_TLKEXT | 0x08000000 | TLKEXT | This allows 10 instead of 8 parameters in TKL's
3. FUNCTIONS AND EVENTS
===================================================================================================
4. FUNCTIONS AND EVENTS
A brief word about functions and events. All events are captured via the
@@ -298,35 +442,3 @@ following steps
Define Table
======================================================================================================
DEFINE WORD | VALUE | TOKEN | IRCD Meaning
======================================================================================================
CAPAB_NOQUIT | 0x00000001 | NOQUIT | Supports NOQUIT
CAPAB_TSMODE | 0x00000002 | TS | Channel modes are TimeStamped (normal sent during PASS)
CAPAB_UNCONNECT | 0x00000004 | UNCONNECT | Supports UNCONNECT
CAPAB_NICKIP | 0x00000008 | NICKIP | IP in the NICK line
CAPAB_NSJOIN | 0x00000010 | SSJOIN | smart sjoin SSJOIN
CAPAB_ZIP | 0x00000020 | ZIP | server supports gz'd links
CAPAB_BURST | 0x00000040 | BURST | server supports BURST command
CAPAB_TS3 | 0x00000080 | TS3 | Supports the TS3 Protocol
CAPAB_TS5 | 0x00000100 | TS5 | Supports the TS5 Protocol
CAPAB_DKEY | 0x00000200 | DKEY | server supports dh-key exchange using "DKEY"
CAPAB_DOZIP | 0x00000400 | ZIP | output to this link shall be gzipped
CAPAB_DODKEY | 0x00000800 | DKEY | do I do dkey with this link?
CAPAB_QS | 0x00001000 | QS | Can handle quit storm removal
CAPAB_SCS | 0x00002000 | SCS | Supports String Cache System
CAPAB_PT4 | 0x00004000 | PT4 | PT4 Protocol Support
CAPAB_UID | 0x00008000 | UID | Can do UIDs
CAPAB_KNOCK | 0x00010000 | KNOCK | supports KNOCK
CAPAB_CLIENT | 0x00020000 | CLIENT | Supports CLIENT
CAPAB_IPV6 | 0x00040000 | IPV6 | Server is able to handle ipv6 address masks
CAPAB_SSJ5 | 0x00080000 | SSJ5 | Server supports smart join protocol 5
CAPAB_SN2 | 0x00100000 | SN2 | Supports SN2 protocol (SNICK 2)
CAPAB_VHOST | 0x00200000 | VHOST | Supports VHOST protocol
CAPAB_TOKEN | 0x00400000 | TOKEN | Supports tokenized server<->server commands
CAPAB_SSJ3 | 0x00800000 | SSJ3 | Server supports smart join protocol 3
CAPAB_NICK2 | 0x01000000 | NICK2 | supports the extended NICK command (version 2)
CAPAB_UMODE2 | 0x02000000 | UMODE2 | support for the UMODE2 command
CAPAB_VL | 0x04000000 | VL | Vline information is included in the info field
CAPAB_TLKEXT | 0x08000000 | TLKEXT | This allows 10 instead of 8 parameters in TKL's
+5 -1
View File
@@ -10,7 +10,7 @@ details.
Information about Anope may be found at http://www.anope.org/
Information about Epona may be found at http://www.epona.org/
Information about Services may be found at http://www.ircservices.za.net/
Information about Services may be found at http://www.ircservices.esper.net/
TABLE OF CONTENTS
-----------------
@@ -133,6 +133,10 @@ Anope currently works with:
- Hybrid 7 or later
- PTlink 6.15 or later
- RageIRCd 2.0 beta-6 or later
- Solid IRCD 3.4.6 or later
- Plexus 2.0 or later
- Ratbox 2.0 or later
Anope could also work with some of the daemons derived by the ones
listed above, but there's no support for them if they work or don't
+206 -193
View File
@@ -27,12 +27,12 @@ E IRCDCAPAB ircdcap[];
E const char flood_mode_char_set[];
E const char flood_mode_char_remove[];
E int UseTSMODE; /* hack to get around bahamut clones that don't send TSMODE */
extern unsigned long umodes[128];
extern char csmodes[128];
extern CMMode cmmodes[128];
extern CBMode cbmodes[128];
extern CBModeInfo cbmodeinfos[];
extern CUMode cumodes[128];
E unsigned long umodes[128];
E char csmodes[128];
E CMMode cmmodes[128];
E CBMode cbmodes[128];
E CBModeInfo cbmodeinfos[];
E CUMode cumodes[128];
/**** actions.c ****/
@@ -69,25 +69,25 @@ E CMMode cmmodes[128];
E unsigned long umodes[128];
E char csmodes[128];
extern void add_ban(Channel * chan, char *mask);
extern void chan_adduser2(User * user, Channel * c);
extern void add_invite(Channel * chan, char *mask);
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 void del_invite(Channel * chan, char *mask);
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);
E void add_ban(Channel * chan, char *mask);
E void chan_adduser2(User * user, Channel * c);
E void add_invite(Channel * chan, char *mask);
E void chan_delete(Channel * c);
E void del_ban(Channel * chan, char *mask);
E void set_key(Channel * chan, char *value);
E void set_limit(Channel * chan, char *value);
E void del_invite(Channel * chan, char *mask);
E char *get_key(Channel * chan);
E char *get_limit(Channel * chan);
E Channel *chan_create(char *chan);
E 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 add_exception(Channel * chan, char *mask);
E void del_exception(Channel * chan, char *mask);
E char *get_flood(Channel * chan);
E void set_flood(Channel * chan, char *value);
E char *get_redirect(Channel * chan);
E void set_redirect(Channel * chan, char *value);
E void get_channel_stats(long *nrec, long *memuse);
@@ -232,7 +232,6 @@ E char *s_BotServ;
E char *s_HelpServ;
E char *s_OperServ;
E char *s_GlobalNoticer;
E char *s_IrcIIHelp;
E char *s_DevNull;
E char *desc_NickServ;
E char *desc_ChanServ;
@@ -241,7 +240,6 @@ E char *desc_BotServ;
E char *desc_HelpServ;
E char *desc_OperServ;
E char *desc_GlobalNoticer;
E char *desc_IrcIIHelp;
E char *desc_DevNull;
E char *HostDBName;
@@ -306,6 +304,7 @@ E int UseTokens;
E int NewsCount;
E int Numeric;
E int UnRestrictSAdmin;
E int UseTS6;
E char **HostSetters;
E int HostNumber;
@@ -676,11 +675,11 @@ E int nickIsServices(char *nick, int bot);
E void add_entropy_userkeys(void);
E void rand_init(void);
E u_char getrandom8(void);
E unsigned char getrandom8(void);
E u_int16_t getrandom16(void);
E u_int32_t getrandom32(void);
E char *str_signed(u_char *str);
E char *str_signed(unsigned char *str);
/**** modules.c ****/
E void moduleCallBackRun(void);
@@ -902,6 +901,16 @@ E User *finduser(const char *nick);
E User *firstuser(void);
E User *nextuser(void);
E User *find_byuid(const char *uid);
E User *first_uid(void);
E User *next_uid(void);
E Uid *new_uid(const char *nick, char *uid);
E Uid *find_uid(const char *nick);
E Uid *find_nickuid(const char *uid);
E Server *findserver_uid(Server * s, const char *name);
E char *TS6SID;
E char *TS6UPLINK;
E void update_host(User * user);
E void change_user_host(User * user, const char *host);
E void change_user_username(User * user, const char *username);
@@ -962,7 +971,7 @@ E unsigned int mysql_rand(void);
#endif
#ifdef USE_ENCRYPTION
extern int encrypt_in_place(char *buf, int size);
E int encrypt_in_place(char *buf, int size);
#endif
@@ -971,178 +980,182 @@ 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(User *u);
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, char *whom); /* SZLINE */
extern void anope_cmd_squit(char *servname, char *message); /* SQUIT */
extern void anope_cmd_svinfo(); /* SVINFO */
extern void anope_cmd_svsadmin(char *server, int set); /* SVSADMIN */
extern void anope_cmd_svshold(char *nick); /* SVSHOLD */
extern void anope_cmd_release_svshold(char *nick); /* SVSHOLD */
extern void anope_cmd_svsinfo(); /* SVSINFO */
extern void anope_cmd_svsjoin(char *source, char *nick,char *chan); /* SVSJOIN */
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_svsmode_chan(char *name, char *mode, char *nick); /* 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_svspart(char *source, char *nick,char *chan); /* SVSPART */
extern void anope_cmd_swhois(char *source, char *who, char *mask); /* SWHOIS */
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 void anope_cmd_eob(); /* EOB - end of burst */
extern void anope_cmd_burst(); /* BURST - use eob to send burst 0 */
extern void anope_cmd_svswatch(char *sender, char *nick, char *parm);
extern void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...); /* CTCP */
E void anope_cmd_211(const char *fmt, ...); /* 211 */
E void anope_cmd_219(char *source, char *who); /* 219 */
E void anope_cmd_242(const char *fmt, ...); /* 242 */
E void anope_cmd_243(const char *fmt, ...); /* 243 */
E void anope_cmd_250(const char *fmt, ...); /* 250 */
E void anope_cmd_307(const char *fmt, ...); /* 307 */
E void anope_cmd_311(const char *fmt, ...); /* 311 */
E void anope_cmd_312(const char *fmt, ...); /* 312 */
E void anope_cmd_317(const char *fmt, ...); /* 317 */
E void anope_cmd_318(char *source, char *who); /* 318 */
E void anope_cmd_351(char *source); /* 351 */
E void anope_cmd_372(char *source, char *msg); /* 372 */
E void anope_cmd_372_error(char *source); /* 372 */
E void anope_cmd_375(char *source); /* 375 */
E void anope_cmd_376(char *source); /* 376 */
E void anope_cmd_391(char *source, char *timestr); /* 391 */
E void anope_cmd_401(char *source, char *who); /* 401 */
E void anope_cmd_akill(char *user, char *host, char *who, time_t when, time_t expires, char *reason); /* AKILL */
E void anope_cmd_capab(); /* CAPAB */
E void anope_cmd_chghost(char *nick, char *vhost); /* CHGHOST */
E void anope_cmd_chgident(char *nick, char *vIdent); /* CHGIDENT */
E void anope_cmd_vhost_on(char *nick, char *vIdent, char *vhost); /* CHGHOST + CHGIDENT */
E void anope_cmd_vhost_off(User *u);
E void anope_cmd_connect(int servernum); /* Connect */
E void anope_cmd_ea(); /* EA */
E void anope_cmd_global(char *source, const char *fmt, ...); /* GLOBOPS */
E void anope_cmd_invite(char *source, char *chan, char *nick); /* INVITE */
E void anope_cmd_join(char *user, char *channel, time_t chantime); /* JOIN */
E void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt, ...); /* KICK */
E void anope_cmd_mode(char *source, char *dest, const char *fmt, ...); /* MODE */
E void anope_cmd_tmode(char *source, char *dest, const char *fmt, ...); /* TMODE */
E void anope_cmd_unban(char *name, char *nick); /* MODE -b */
E void anope_cmd_bot_chan_mode(char *nick, char *chan); /* MODE BotServ */
E void anope_cmd_netinfo(int ac, char **av); /* NETINFO */
E void anope_cmd_nick(char *nick, char *name, char *mode); /* NICK */
E void anope_cmd_chg_nick(char *oldnick, char *newnick); /* NICK */
E void anope_cmd_bot_nick(char *nick, char *user,char *host,char *real,char *modes); /* NICK */
E void anope_cmd_guest_nick(char *nick, char *user,char *host,char *real,char *modes); /* NICK */
E void anope_cmd_notice(char *source, char *dest, const char *fmt, ...); /* NOTICE */
E void anope_cmd_notice_ops(char *source, char *dest, const char *fmt, ...); /* NOTICE */
E void anope_cmd_notice2(char *source, char *dest, char *msg); /* NOTICE */
E void anope_cmd_serv_notice(char *source, char *dest, char *msg); /* NOTICE */
E void anope_cmd_part(char *nick, char *chan, const char *fmt, ...); /* PART */
E void anope_cmd_pass(char *pass); /* PASS */
E void anope_cmd_pong(char *servname, char *who); /* PONG */
E void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...); /* PRIVMSG */
E void anope_cmd_privmsg2(char *source, char *dest, char *msg); /* PRIVMSG */
E void anope_cmd_serv_privmsg(char *source, char *dest, char *msg); /* PRIVMSG */
E void anope_cmd_protoctl(); /* PROTOCTL */
E void anope_cmd_quit(char *source, const char *fmt, ...); /* QUIT */
E void anope_cmd_remove_akill(char *user, char *host); /* RAKILL */
E void anope_cmd_server(char *servname, int hop, char *descript); /* SERVER */
E void anope_cmd_sgline(char *mask, char *reason); /* SGLINE */
E void anope_cmd_sqline(char *mask, char *reason); /* SQLINE */
E void anope_cmd_szline(char *mask, char *reason, char *whom); /* SZLINE */
E void anope_cmd_squit(char *servname, char *message); /* SQUIT */
E void anope_cmd_svinfo(); /* SVINFO */
E void anope_cmd_svsadmin(char *server, int set); /* SVSADMIN */
E void anope_cmd_svshold(char *nick); /* SVSHOLD */
E void anope_cmd_release_svshold(char *nick); /* SVSHOLD */
E void anope_cmd_svsinfo(); /* SVSINFO */
E void anope_cmd_svsjoin(char *source, char *nick,char *chan); /* SVSJOIN */
E void anope_cmd_svskill(char *source,char *user, const char *fmt, ...); /* SVSKILL */
E void anope_cmd_svsmode(User * u, int ac, char **av); /* SVSMODE */
E void anope_cmd_svsmode_chan(char *name, char *mode, char *nick); /* SVSMODE */
E void anope_cmd_svsnick(char *nick,char *newnick, time_t when); /* SVSNICK */
E void anope_cmd_svsnoop(char *server, int set); /* SVSNOOP */
E void anope_cmd_svso(char *source,char *nick, char *flag); /* SVSO */
E void anope_cmd_svspart(char *source, char *nick,char *chan); /* SVSPART */
E void anope_cmd_swhois(char *source, char *who, char *mask); /* SWHOIS */
E void anope_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); /* TOPIC */
E void anope_cmd_unsgline(char *mask); /* UNSGLINE */
E void anope_cmd_unsqline(char *user); /* UNSQLINE */
E void anope_cmd_unszline(char *mask); /* UNSZLINE */
E void anope_cmd_eob(); /* EOB - end of burst */
E void anope_cmd_burst(); /* BURST - use eob to send burst 0 */
E void anope_cmd_svswatch(char *sender, char *nick, char *parm);
E void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...); /* CTCP */
extern int anope_event_482(char *source, int ac, char **av);
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_gnotice(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);
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_eob(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 int anope_event_netctrl(char *source, int ac, char **av);
extern int anope_event_notice(char *source, int ac, char **av);
extern int anope_event_snotice(char *source, int ac, char **av);
extern int anope_event_sqline(char *source, int ac, char **av);
extern int anope_event_error(char *source, int ac, char **av);
extern int anope_event_smo(char *source, int ac, char **av);
extern int anope_event_myid(char *source, int ac, char **av);
extern int anope_event_vctrl(char *source, int ac, char **av);
extern int anope_event_tctrl(char *source, int ac, char **av);
extern int anope_event_netinfo(char *source, int ac, char **av);
extern int anope_event_snetinfo(char *source, int ac, char **av);
extern int anope_event_umode2(char *source, int ac, char **av);
extern int anope_event_globops(char *source, int ac, char **av);
extern int anope_event_swhois(char *source, int ac, char **av);
extern int anope_event_burst(char *source, int ac, char **av);
extern int anope_event_luserslock(char *source, int ac, char **av);
extern int anope_event_admin(char *source, int ac, char **av);
extern int anope_event_credits(char *source, int ac, char **av);
extern int anope_event_rehash(char *source, int ac, char **av);
extern int anope_event_sdesc(char *source, int ac, char **av);
extern int anope_event_netglobal(char *source, int ac, char **av);
extern int anope_event_invite(char *source, int ac, char **av);
extern int anope_event_null(char *source, int ac, char **av);
E int anope_event_482(char *source, int ac, char **av);
E int anope_event_436(char *source, int ac, char **av);
E int anope_event_away(char *source, int ac, char **av);
E int anope_event_ping(char *source, int ac, char **av);
E int anope_event_motd(char *source, int ac, char **av);
E int anope_event_join(char *source, int ac, char **av);
E int anope_event_kick(char *source, int ac, char **av);
E int anope_event_kill(char *source, int ac, char **av);
E int anope_event_mode(char *source, int ac, char **av);
E int anope_event_tmode(char *source, int ac, char **av);
E int anope_event_quit(char *source, int ac, char **av);
E int anope_event_squit(char *source, int ac, char **av);
E int anope_event_topic(char *source, int ac, char **av);
E int anope_event_whois(char *source, int ac, char **av);
E int anope_event_part(char *source, int ac, char **av);
E int anope_event_server(char *source, int ac, char **av);
E int anope_event_sid(char *source, int ac, char **av);
E int anope_event_nick(char *source, int ac, char **av);
E int anope_event_bmask(char *source, int ac, char **av);
E int anope_event_gnotice(char *source, int ac, char **av);
E int anope_event_privmsg(char *source, int ac, char **av);
E int anope_event_capab(char *source, int ac, char **av);
E int anope_event_sjoin(char *source, int ac, char **av);
E int anope_event_cs(char *source, int ac, char **av);
E int anope_event_hs(char *source, int ac, char **av);
E int anope_event_ms(char *source, int ac, char **av);
E int anope_event_ns(char *source, int ac, char **av);
E int anope_event_os(char *source, int ac, char **av);
E int anope_event_vs(char *source, int ac, char **av);
E int anope_event_svinfo(char *source, int ac, char **av);
E int anope_event_chghost(char *source, int ac, char **av);
E int anope_event_sethost(char *source, int ac, char **av);
E int anope_event_chgident(char *source, int ac, char **av);
E int anope_event_setident(char *source, int ac, char **av);
E int anope_event_chgname(char *source, int ac, char **av);
E int anope_event_setname(char *source, int ac, char **av);
E int anope_event_svsinfo(char *source, int ac, char **av);
E int anope_event_snick(char *source, int ac, char **av);
E int anope_event_vhost(char *source, int ac, char **av);
E int anope_event_tkl(char *source, int ac, char **av);
E int anope_event_eos(char *source, int ac, char **av);
E int anope_event_eob(char *source, int ac, char **av);
E int anope_event_pass(char *source, int ac, char **av);
E int anope_event_netinfo(char *source, int ac, char **av);
E int anope_event_error(char *source, int ac, char **av);
E int anope_event_eb(char *source, int ac, char **av);
E int anope_event_netctrl(char *source, int ac, char **av);
E int anope_event_notice(char *source, int ac, char **av);
E int anope_event_snotice(char *source, int ac, char **av);
E int anope_event_sqline(char *source, int ac, char **av);
E int anope_event_error(char *source, int ac, char **av);
E int anope_event_smo(char *source, int ac, char **av);
E int anope_event_myid(char *source, int ac, char **av);
E int anope_event_vctrl(char *source, int ac, char **av);
E int anope_event_tctrl(char *source, int ac, char **av);
E int anope_event_netinfo(char *source, int ac, char **av);
E int anope_event_snetinfo(char *source, int ac, char **av);
E int anope_event_umode2(char *source, int ac, char **av);
E int anope_event_globops(char *source, int ac, char **av);
E int anope_event_swhois(char *source, int ac, char **av);
E int anope_event_burst(char *source, int ac, char **av);
E int anope_event_luserslock(char *source, int ac, char **av);
E int anope_event_admin(char *source, int ac, char **av);
E int anope_event_credits(char *source, int ac, char **av);
E int anope_event_rehash(char *source, int ac, char **av);
E int anope_event_sdesc(char *source, int ac, char **av);
E int anope_event_netglobal(char *source, int ac, char **av);
E int anope_event_invite(char *source, int ac, char **av);
E int anope_event_null(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 int anope_flood_mode_check(char *value);
E void anope_set_umode(User * user, int ac, char **av);
E void anope_cmd_svid_umode(char *nick, time_t ts);
E void anope_cmd_svid_umode2(User *u, char *ts);
E void anope_cmd_svid_umode3(User *u, char *ts);
E void anope_cmd_nc_change(User *u);
E int anope_flood_mode_check(char *value);
extern void anope_cmd_jupe(char *jserver, char *who, char *reason);
E void anope_cmd_jupe(char *jserver, char *who, char *reason);
extern void anope_cmd_global_legacy(char *source, char *fmt);
extern void wallops(char *source, const char *fmt, ...);
E void anope_cmd_global_legacy(char *source, char *fmt);
E void wallops(char *source, const char *fmt, ...);
extern int anope_valid_nick(char *nick);
E int anope_valid_nick(char *nick);
extern char *common_get_vident(User *u);
extern char *common_get_vhost(User *u);
extern char *send_token(char *token1, char *token2);
extern char *base64enc(long i);
extern long base64dec(char *b64);
extern long base64dects(char *ts);
extern int b64_encode(char *src, size_t srclength, char *target, size_t targsize);
extern int b64_decode(char *src, char *target, size_t targsize);
extern char *encode_ip(u_char *ip);
extern int decode_ip(char *buf);
E char *common_get_vident(User *u);
E char *common_get_vhost(User *u);
E char *send_token(char *token1, char *token2);
E char *base64enc(long i);
E long base64dec(char *b64);
E long base64dects(char *ts);
E int b64_encode(char *src, size_t srclength, char *target, size_t targsize);
E int b64_decode(char *src, char *target, size_t targsize);
E char *encode_ip(unsigned char *ip);
E int decode_ip(char *buf);
#define Anope_Free(x) if ((x) != NULL) free(x)
extern char *host_resolve(char *host);
E char *host_resolve(char *host);
#endif /* EXTERN_H */
+61
View File
@@ -0,0 +1,61 @@
/* Ratbox 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_RATBOX
#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_C 0x00000002
#define UMODE_i 0x00000004
#define UMODE_o 0x00000008
#define UMODE_z 0x00000010
#define UMODE_w 0x00000020
#define UMODE_s 0x00000040
#define UMODE_c 0x00000080
#define UMODE_r 0x00000100
#define UMODE_k 0x00000200
#define UMODE_f 0x00000400
#define UMODE_y 0x00000800
#define UMODE_d 0x00001000
#define UMODE_n 0x00002000
#define UMODE_x 0x00004000
#define UMODE_u 0x00008000
#define UMODE_b 0x00010000
#define UMODE_l 0x00020000
#define UMODE_g 0x00040000
#define UMODE_Z 0x00080000
#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
#define CMODE_l 0x00000080
#define DEFAULT_MLOCK CMODE_n | CMODE_t
#endif
+13
View File
@@ -158,6 +158,7 @@ typedef struct csmode_ CSMode;
typedef struct cumode_ CUMode;
typedef struct csmodeutil_ CSModeUtil;
typedef struct session_ Session;
typedef struct uid_ Uid;
/*************************************************************************/
@@ -180,6 +181,7 @@ typedef enum { false, true } boolean;
#include "unreal32.h"
#include "solidircd.h"
#include "plexus.h"
#include "ratbox.h"
typedef struct ircdvars_ IRCDVar;
typedef struct ircdcapab_ IRCDCAPAB;
@@ -264,6 +266,8 @@ struct ircdvars_ {
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
int sglineenforce;
char *vhostchar; /* char used for vhosting */
int ts6; /* ircd is TS6 */
int supporthelper; /* +h helper umodes */
};
struct ircdcapab_ {
@@ -299,6 +303,15 @@ struct ircdcapab_ {
uint32 sjb64;
};
/* tiny struct needed for P10 and other UID servers so we can track
services UID
*/
struct uid_ {
Uid *next, *prev;
char nick[NICKMAX];
char *uid;
};
/*************************************************************************/
/* File version for each database. Was one version for all before but was
+3 -4
View File
@@ -126,6 +126,9 @@
/* "First IRCD type" */
#undef IRC_VIAGRA
/* "First IRCD type" */
#undef IRC_RATBOX
/* "Module dir" */
#undef MODULE_PATH
@@ -230,10 +233,6 @@ int ftruncate(int fd, off_t length);
char *strsignal(int sig);
#endif
/* Freebsd 5.2.1 actually has u_char those it throws more
errors having it defined again - TSL */
#undef u_char
typedef unsigned char u_char;
#endif
+3 -3
View File
@@ -105,6 +105,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
NULL, /* vhost char */
0, /* ts6 */
1, /* support helper umode */
}
,
{NULL}
@@ -902,8 +904,6 @@ void anope_cmd_capab()
/* EVENT : SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
@@ -1668,7 +1668,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
/* this avoids "undefined symbol" messages of those whom try to load mods that
+7 -7
View File
@@ -106,8 +106,8 @@ static const char Pad64 = '=';
int b64_encode(char *src, size_t srclength, char *target, size_t targsize)
{
size_t datalength = 0;
u_char input[3];
u_char output[4];
unsigned char input[3];
unsigned char output[4];
size_t i;
while (2 < srclength) {
@@ -280,10 +280,10 @@ int b64_decode(char *src, char *target, size_t targsize)
return (tarindex);
}
char *encode_ip(u_char * ip)
char *encode_ip(unsigned char *ip)
{
static char buf[25];
u_char *cp;
unsigned char *cp;
struct in_addr ia; /* For IPv4 */
char *s_ip; /* Signed ip string */
@@ -295,7 +295,7 @@ char *encode_ip(u_char * ip)
} else {
s_ip = str_signed(ip);
ia.s_addr = inet_addr(s_ip);
cp = (u_char *) ia.s_addr;
cp = (unsigned char *) ia.s_addr;
b64_encode((char *) &cp, sizeof(struct in_addr), buf, 25);
}
return buf;
@@ -378,14 +378,14 @@ static char *int_to_base64(long val)
static long base64_to_int(char *b64)
{
int v = base64_to_int6_map[(u_char) * b64++];
int v = base64_to_int6_map[(unsigned char) *b64++];
if (!b64)
return 0;
while (*b64) {
v <<= 6;
v += base64_to_int6_map[(u_char) * b64++];
v += base64_to_int6_map[(unsigned char) *b64++];
}
return v;
+16 -2
View File
@@ -818,13 +818,27 @@ static int delbot(BotInfo * bi)
BotInfo *findbot(char *nick)
{
BotInfo *bi;
Uid *ud;
/* to keep make strict happy */
ud = NULL;
if (!nick || !*nick)
return NULL;
for (bi = botlists[tolower(*nick)]; bi; bi = bi->next)
if (!stricmp(nick, bi->nick))
for (bi = botlists[tolower(*nick)]; bi; bi = bi->next) {
if (UseTS6 && ircd->ts6) {
ud = find_nickuid(nick);
}
if (!stricmp(nick, bi->nick)) {
return bi;
}
if (ud && UseTS6 && ircd->ts6) {
if (!stricmp(ud->nick, bi->nick)) {
return bi;
}
}
}
return NULL;
}
+112 -11
View File
@@ -180,7 +180,6 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
CBMode *cbm;
CMMode *cmm;
CUMode *cum;
int botcheck = 0;
unsigned char botmode;
BotInfo *bi;
@@ -326,7 +325,7 @@ void chan_set_user_status(Channel * chan, User * user, int16 status)
{
struct u_chanlist *uc;
if (HelpChannel
if (HelpChannel && ircd->supporthelper
&& (status == CUS_OP || status == (CUS_PROTECT | CUS_OP)
|| status == (CUS_OWNER | CUS_OP))
&& !stricmp(chan->name, HelpChannel)) {
@@ -524,7 +523,11 @@ void do_join(const char *source, int ac, char **av)
char *s, *t;
struct u_chanlist *c, *nextc;
user = finduser(source);
if (UseTS6 && ircd->ts6) {
user = find_byuid(source);
} else {
user = finduser(source);
}
if (!user) {
alog("user: JOIN from nonexistent user %s: %s", source,
merge_args(ac, av));
@@ -600,14 +603,26 @@ void do_kick(const char *source, int ac, char **av)
continue;
}
user = finduser(s);
if (UseTS6 && ircd->ts6) {
user = find_byuid(s);
if (!user) {
user = finduser(s);
}
} else {
user = finduser(s);
}
if (!user) {
alog("user: KICK for nonexistent user %s on %s: %s", s, av[0],
merge_args(ac - 2, av + 2));
continue;
}
if (debug)
alog("debug: kicking %s from %s", s, av[0]);
if (debug) {
if (UseTS6 && ircd->ts6) {
alog("debug: kicking %s from %s", user->nick, av[0]);
} else {
alog("debug: kicking %s from %s", s, av[0]);
}
}
for (c = user->chans; c && stricmp(av[0], c->chan->name) != 0;
c = c->next);
if (c) {
@@ -711,8 +726,6 @@ void do_sjoin(const char *source, int ac, char **av)
Channel *c;
User *user;
char *s, *end, cubuf[7], *end2, *cumodes[6];
int is_sqlined = 0;
int ts = 0;
@@ -778,7 +791,12 @@ void do_sjoin(const char *source, int ac, char **av)
*end2++ = csmodes[(int) *s++];
*end2 = 0;
user = finduser(s);
if (UseTS6 && ircd->ts6) {
user = find_byuid(s);
} else {
user = finduser(s);
}
if (!user) {
alog("user: SJOIN for nonexistent user %s on %s", s,
av[1]);
@@ -822,7 +840,7 @@ void do_sjoin(const char *source, int ac, char **av)
}
/* Unreal just had to be different */
} else if (ac == 3) {
} else if (ac == 3 && !ircd->ts6) {
c = findchan(av[1]);
if (ircd->chansqline) {
if (!c)
@@ -847,6 +865,7 @@ void do_sjoin(const char *source, int ac, char **av)
*end2 = 0;
user = finduser(s);
if (!user) {
alog("user: SJOIN for nonexistent user %s on %s", s,
av[1]);
@@ -885,8 +904,80 @@ void do_sjoin(const char *source, int ac, char **av)
if (c) {
c->creation_time = ts;
}
} else if (ac == 3 && ircd->ts6) {
c = findchan(av[1]);
if (ircd->chansqline) {
if (!c)
is_sqlined = check_chan_sqline(av[1]);
}
cubuf[0] = '+';
cumodes[0] = cubuf;
/* We make all the users join */
s = sstrdup(source); /* Users are always the last element */
while (*s) {
end = strchr(s, ' ');
if (end)
*end = 0;
end2 = cubuf + 1;
while (csmodes[(int) *s] != 0)
*end2++ = csmodes[(int) *s++];
*end2 = 0;
if (UseTS6 && ircd->ts6) {
user = find_byuid(s);
} else {
user = finduser(s);
}
if (!user) {
alog("user: SJOIN for nonexistent user %s on %s", s,
av[1]);
return;
}
if (is_sqlined && !is_oper(user)) {
anope_cmd_kick(s_OperServ, av[1], s, "Q-Lined");
} else {
if (!check_kick(user, av[1])) {
/* Make the user join; if the channel does not exist it
* will be created there. This ensures that the channel
* is not created to be immediately destroyed, and
* that the locked key or topic is not shown to anyone
* who joins the channel when empty.
*/
c = join_user_update(user, c, av[1]);
/* We update user mode on the channel */
if (end2 - cubuf > 1) {
int i;
for (i = 1; i < end2 - cubuf; i++)
cumodes[i] = user->nick;
chan_set_modes(source, c, 1 + (end2 - cubuf - 1),
cumodes, 1);
}
}
}
if (!end)
break;
s = end + 1;
}
if (c) {
c->creation_time = ts;
}
free(s);
} else if (ac == 2) {
user = finduser(source);
if (UseTS6 && ircd->ts6) {
user = find_byuid(source);
} else {
user = finduser(source);
}
if (!user) {
alog("user: SJOIN for nonexistent user %s on %s", source,
av[1]);
@@ -945,6 +1036,16 @@ void do_cmode(const char *source, int ac, char **av)
}
}
/* :42XAAAAAO TMODE 1106409026 #ircops +b *!*@*.aol.com */
if (UseTS6 && ircd->ts6) {
alog("chan %s : mode %s : extra %s", av[1], av[2], av[3]);
av[0] = sstrdup(av[1]);
av[1] = sstrdup(av[2]);
av[2] = sstrdup(av[3]);
alog("chan %s : mode %s : extra %s", av[0], av[1], av[2]);
}
chan = findchan(av[0]);
if (!chan) {
ci = cs_findchan(av[0]);
+68
View File
@@ -332,6 +332,8 @@ char *UlineServers;
char **Ulines;
int NumUlines;
int UseTS6;
/*************************************************************************/
/* Deprecated directive (dep_) and value checking (chk_) functions: */
@@ -633,6 +635,7 @@ Directive directives[] = {
{"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}},
{"UseSVS2MODE", {{PARAM_SET, PARAM_RELOAD, &UseSVS2MODE}}},
{"UseTokens", {{PARAM_SET, 0, &UseTokens}}},
{"UseTS6", {{PARAM_SET, 0, &UseTS6}}},
{"UnRestrictSAdmin", {{PARAM_SET, PARAM_RELOAD, &UnRestrictSAdmin}}},
{"WallAkillExpire", {{PARAM_SET, PARAM_RELOAD, &WallAkillExpire}}},
{"WallBadOS", {{PARAM_SET, PARAM_RELOAD, &WallBadOS}}},
@@ -985,6 +988,56 @@ int read_config(int reload)
CHEK2(s_GlobalNoticer, GlobalName);
CHEK2(PIDFilename, PIDFile);
}
if (s_ChanServAlias) {
if (!stricmp(s_ChanServ, s_ChanServAlias)) {
printf
("\n*** ChanServ and ChanServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
if (s_NickServAlias) {
if (!stricmp(s_NickServ, s_NickServAlias)) {
printf
("\n*** NickServ and NickServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
if (s_OperServAlias) {
if (!stricmp(s_OperServ, s_OperServAlias)) {
printf
("\n*** OperServ and OperServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
if (s_MemoServAlias) {
if (!stricmp(s_MemoServ, s_MemoServAlias)) {
printf
("\n*** MemoServ and MemoServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
if (s_HelpServAlias) {
if (!stricmp(s_HelpServ, s_HelpServAlias)) {
printf
("\n*** HelpServ and HelpServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
if (s_GlobalNoticerAlias) {
if (!stricmp(s_GlobalNoticer, s_GlobalNoticerAlias)) {
printf
("\n*** GlobalNoticer and GlobalNoticer Alias are the same, this will cause errors\n");
retval = 0;
}
}
CHEK2(MOTDFilename, MOTDFile);
if (!reload) {
CHEK2(NickDBName, NickServDB);
@@ -1287,11 +1340,26 @@ int read_config(int reload)
CHECK(BSBadWordsMax);
CHECK(BSMinUsers);
CHECK(BSKeepData);
if (s_BotServAlias) {
if (!stricmp(s_BotServ, s_BotServAlias)) {
printf
("\n*** BotServ and BotServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
}
if (s_HostServ) {
CHEK2(s_HostServ, HostServName);
CHEK2(HostDBName, HostServDB);
if (s_HostServAlias) {
if (!stricmp(s_HostServ, s_HostServAlias)) {
printf
("\n*** HostServ and HostServ Alias are the same, this will cause errors\n");
retval = 0;
}
}
}
if (UseMail) {
+126 -29
View File
@@ -18,14 +18,15 @@
static int curday = 0;
/*************************************************************************/
/*************************************************************************/
/* Return the version number on the file. Return 0 if there is no version
/**
* Return the version number on the file. Return 0 if there is no version
* number or the number doesn't make sense (i.e. less than 1 or greater
* than FILE_VERSION).
* @param f dbFile Struct Member
* @return int 0 if failure, 1 > is the version number
*/
int get_file_version(dbFILE * f)
{
FILE *fp = f->fp;
@@ -53,10 +54,11 @@ int get_file_version(dbFILE * f)
/*************************************************************************/
/* Write the current version number to the file. Return 0 on error, 1 on
* success.
/**
* Write the current version number to the file.
* @param f dbFile Struct Member
* @return 0 on error, 1 on success.
*/
int write_file_version(dbFILE * f, uint32 version)
{
FILE *fp = f->fp;
@@ -72,9 +74,14 @@ int write_file_version(dbFILE * f, uint32 version)
return 1;
}
/*************************************************************************/
/*************************************************************************/
/**
* Open the database for reading
* @param service If error whom to return the error as
* @param filename File to open as the database
* @return dbFile struct
*/
static dbFILE *open_db_read(const char *service, const char *filename)
{
dbFILE *f;
@@ -107,6 +114,13 @@ static dbFILE *open_db_read(const char *service, const char *filename)
/*************************************************************************/
/**
* Open the database for writting
* @param service If error whom to return the error as
* @param filename File to open as the database
* @param version Database Version
* @return dbFile struct
*/
static dbFILE *open_db_write(const char *service, const char *filename,
uint32 version)
{
@@ -198,15 +212,20 @@ static dbFILE *open_db_write(const char *service, const char *filename,
/*************************************************************************/
/* Open a database file for reading (*mode == 'r') or writing (*mode == 'w').
/**
* Open a database file for reading (*mode == 'r') or writing (*mode == 'w').
* Return the stream pointer, or NULL on error. When opening for write, it
* is an error for rename() to return an error (when backing up the original
* file) other than ENOENT, if NO_BACKUP_OKAY is not defined; it is an error
* if the version number cannot be written to the file; and it is a fatal
* error if opening the file for write fails and the backup was successfully
* made but cannot be restored.
* @param service If error whom to return the error as
* @param filename File to open as the database
* @param mode Mode for writting or reading
* @param version Database Version
* @return dbFile struct
*/
dbFILE *open_db(const char *service, const char *filename,
const char *mode, uint32 version)
{
@@ -222,12 +241,14 @@ dbFILE *open_db(const char *service, const char *filename,
/*************************************************************************/
/* Restore the database file to its condition before open_db(). This is
/**
* Restore the database file to its condition before open_db(). This is
* identical to close_db() for files open for reading; however, for files
* open for writing, we first attempt to restore any backup file before
* closing files.
* @param dbFile struct
* @return void
*/
void restore_db(dbFILE * f)
{
int errno_save = errno;
@@ -273,10 +294,12 @@ void restore_db(dbFILE * f)
/*************************************************************************/
/* Close a database file. If the file was opened for write, remove the
/**
* Close a database file. If the file was opened for write, remove the
* backup we (may have) created earlier.
* @param dbFile struct
* @return void
*/
void close_db(dbFILE * f)
{
if (f->mode == 'w' && *f->backupname
@@ -289,10 +312,10 @@ void close_db(dbFILE * f)
free(f);
}
/*************************************************************************/
/*************************************************************************/
/* Read and write 2- and 4-byte quantities, pointers, and strings. All
/**
* Read and write 2- and 4-byte quantities, pointers, and strings. All
* multibyte values are stored in big-endian order (most significant byte
* first). A pointer is stored as a byte, either 0 if NULL or 1 if not,
* and read pointers are returned as either (void *)0 or (void *)1. A
@@ -301,10 +324,10 @@ void close_db(dbFILE * f)
* Written strings are truncated silently at 65534 bytes, and are always
* null-terminated.
*
* All routines return -1 on error, 0 otherwise.
* @param ret 16bit integer to write
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int read_int16(uint16 * ret, dbFILE * f)
{
int c1, c2;
@@ -317,15 +340,33 @@ int read_int16(uint16 * ret, dbFILE * f)
return 0;
}
/*************************************************************************/
/**
* Write a 16bit integer
*
* @param ret 16bit integer to write
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int write_int16(uint16 val, dbFILE * f)
{
if (fputc((val >> 8) & 0xFF, f->fp) == EOF
|| fputc(val & 0xFF, f->fp) == EOF)
|| fputc(val & 0xFF, f->fp) == EOF) {
return -1;
}
return 0;
}
/*************************************************************************/
/**
* Read a unsigned 32bit integer
*
* @param ret unsigned 32bit integer to read
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int read_int32(uint32 * ret, dbFILE * f)
{
int c1, c2, c3, c4;
@@ -340,6 +381,15 @@ int read_int32(uint32 * ret, dbFILE * f)
return 0;
}
/*************************************************************************/
/**
* Write a unsigned 32bit integer
*
* @param ret unsigned 32bit integer to write
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int write_int32(uint32 val, dbFILE * f)
{
if (fputc((val >> 24) & 0xFF, f->fp) == EOF)
@@ -353,7 +403,15 @@ int write_int32(uint32 val, dbFILE * f)
return 0;
}
/*************************************************************************/
/**
* Read Pointer
*
* @param ret pointer to read
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int read_ptr(void **ret, dbFILE * f)
{
int c;
@@ -365,6 +423,15 @@ int read_ptr(void **ret, dbFILE * f)
return 0;
}
/*************************************************************************/
/**
* Write Pointer
*
* @param ret pointer to write
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int write_ptr(const void *ptr, dbFILE * f)
{
if (fputc(ptr ? 1 : 0, f->fp) == EOF)
@@ -372,7 +439,15 @@ int write_ptr(const void *ptr, dbFILE * f)
return 0;
}
/*************************************************************************/
/**
* Read String
*
* @param ret string
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int read_string(char **ret, dbFILE * f)
{
char *s;
@@ -393,6 +468,15 @@ int read_string(char **ret, dbFILE * f)
return 0;
}
/*************************************************************************/
/**
* Write String
*
* @param ret string
* @param dbFile struct
* @return -1 on error, 0 otherwise.
*/
int write_string(const char *s, dbFILE * f)
{
uint32 len;
@@ -411,11 +495,15 @@ int write_string(const char *s, dbFILE * f)
return 0;
}
/*************************************************************************/
/*************************************************************************/
/* Renames a database */
/**
* Renames a database
*
* @param name Database to name
* @param ext Extention
* @return void
*/
static void rename_database(char *name, char *ext)
{
@@ -431,8 +519,11 @@ static void rename_database(char *name, char *ext)
/*************************************************************************/
/* Removes old databases */
/**
* Removes old databases
*
* @return void
*/
static void remove_backups(void)
{
@@ -465,16 +556,20 @@ static void remove_backups(void)
/*************************************************************************/
/* Handles database backups. */
/**
* Handles database backups.
*
* @return void
*/
void backup_databases(void)
{
time_t t;
struct tm tm;
if (!KeepBackups)
if (!KeepBackups) {
return;
}
time(&t);
tm = *localtime(&t);
@@ -497,11 +592,13 @@ void backup_databases(void)
if (!skeleton) {
rename_database(NickDBName, ext);
if (s_BotServ)
if (s_BotServ) {
rename_database(BotDBName, ext);
}
rename_database(ChanDBName, ext);
if (s_HostServ)
if (s_HostServ) {
rename_database(HostDBName, ext);
}
}
rename_database(OperDBName, ext);
+5 -4
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
NULL, /* vhost char */
0, /* ts6 */
1, /* support helper umode */
}
,
{NULL}
@@ -1107,10 +1109,9 @@ void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt,
/* EVENT: SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1401,7 +1402,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+29 -7
View File
@@ -81,15 +81,23 @@ void moduleAddHostServCmds(void)
/*************************************************************************/
/*************************************************************************/
/* HostServ initialization. */
/**
* HostServ initialization.
* @return void
*/
void hostserv_init(void)
{
moduleAddHostServCmds();
}
/*************************************************************************/
/* Main HostServ routine. */
/**
* Main HostServ routine.
* @param u User Struct
* @param buf Buffer holding the message
* @return void
*/
void hostserv(User * u, char *buf)
{
char *cmd, *s;
@@ -115,8 +123,19 @@ void hostserv(User * u, char *buf)
}
/*************************************************************************/
/* Start of Linked List routines */
/* Start of Linked List routines */
/*************************************************************************/
/**
* Create HostCore list member
* @param next HostCore next slot
* @param nick Nick to add
* @param vIdent Virtual Ident
* @param vHost Virtual Host
* @param creator Person whom set the vhost
* @param time Time the vhost was Set
* @return HostCore
*/
HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent,
char *vHost, char *creator, int32 tmp_time)
{
@@ -158,12 +177,15 @@ HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent,
}
/*************************************************************************/
/**
* Returns either NULL for the head, or the location of the *PREVIOUS*
* record, this is where we need to insert etc..
*
* -rob
**/
* @param head HostCore head
* @param nick Nick to find
* @param found If found
* @return HostCore
*/
HostCore *findHostCore(HostCore * head, char *nick, boolean * found)
{
+5 -4
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
NULL, /* vhost char */
0, /* ts6 */
0, /* support helper umode */
}
,
{NULL}
@@ -971,10 +973,9 @@ int anope_event_whois(char *source, int ac, char **av)
/* EVENT: SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1537,7 +1538,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
+12 -3
View File
@@ -508,7 +508,11 @@ int init(int ac, char **av)
#ifndef USE_THREADS
signal(SIGINT, sighandler);
#else
signal(SIGINT, SIG_DFL);
if (nofork) {
signal(SIGINT, sighandler);
} else {
signal(SIGINT, SIG_DFL);
}
#endif
signal(SIGTERM, sighandler);
signal(SIGQUIT, sighandler);
@@ -656,8 +660,13 @@ int init(int ac, char **av)
}
#endif
/* Make myself known to myself in the serverlist */
me_server =
new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
if (UseTS6 && ircd->ts6) {
me_server =
new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
} else {
me_server =
new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
}
/* Connect to the remote server */
servsock = conn(RemoteServer, RemotePort, LocalHost, LocalPort);
+20 -1
View File
@@ -253,6 +253,8 @@ void do_restart_services(void)
static void services_shutdown(void)
{
User *u, *next;
if (!quitmsg)
quitmsg = "Terminating, reason unknown";
alog("%s", quitmsg);
@@ -263,6 +265,12 @@ static void services_shutdown(void)
if (ircd->chanmodes) {
Anope_Free(ircd->chanmodes);
}
u = firstuser();
while (u) {
next = nextuser();
delete_user(u);
u = next;
}
}
disconn(servsock);
}
@@ -318,7 +326,18 @@ void sighandler(int signum)
quitmsg = "Shutting down on SIGTERM";
services_shutdown();
exit(0);
} else if (signum == SIGINT || signum == SIGQUIT) {
} else if (signum == SIGINT) {
if (nofork) {
signal(SIGINT, SIG_IGN);
alog("Received SIGINT, exiting.");
expire_all();
save_databases();
quitmsg = "Shutting down on SIGINT";
services_shutdown();
exit(0);
}
} else if (signum == SIGQUIT) {
/* nothing -- terminate below */
} else if (!waiting) {
alog("PANIC! buffer = %s", inbuf);
+2 -8
View File
@@ -16,10 +16,8 @@
#include "messages.h"
#include "language.h"
int servernum;
/*************************************************************************/
int m_nickcoll(char *user)
@@ -120,7 +118,7 @@ int m_privmsg(char *source, char *receiver, char *msg)
ChannelInfo *ci;
User *u;
if (!source || !*source) {
if (!source || !*source || !*receiver || !receiver || !msg) {
return MOD_CONT;
}
@@ -128,15 +126,11 @@ int m_privmsg(char *source, char *receiver, char *msg)
if (!u) {
alog("%s: user record for %s not found", msg, source);
anope_cmd_notice(msg, source,
anope_cmd_notice(receiver, source,
getstring(NULL, USER_RECORD_NOT_FOUND));
return MOD_CONT;
}
if (!*receiver || !receiver || !msg) {
return MOD_CONT;
}
if (*receiver == '#') {
if (s_BotServ && (ci = cs_findchan(receiver))) {
/* Some paranoia checks */
+3 -3
View File
@@ -982,9 +982,9 @@ void add_entropy_userkeys(void)
* Get the random numbers 8 byte deep
* @return char
*/
u_char getrandom8(void)
unsigned char getrandom8(void)
{
u_char si, sj;
unsigned char si, sj;
rs.i = (rs.i + 1);
si = rs.s[rs.i];
@@ -1112,7 +1112,7 @@ char *host_resolve(char *host)
* @return output string, same as input string.
*/
char *str_signed(u_char *str)
char *str_signed(unsigned char *str)
{
char *nstr;
+5 -4
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
"h", /* vhost char */
0, /* ts6 */
0, /* support helper umode */
}
,
{NULL}
@@ -1052,10 +1054,9 @@ int anope_event_whois(char *source, int ac, char **av)
/* EVENT: SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1633,7 +1634,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+5 -4
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
NULL, /* vhost char */
0, /* ts6 */
1, /* support helper umode */
}
,
{NULL}
@@ -496,10 +498,9 @@ int anope_event_nick(char *source, int ac, char **av)
*/
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[3], NULL);
return MOD_CONT;
}
@@ -1727,7 +1728,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+5 -4
View File
@@ -104,6 +104,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
"x", /* vhost char */
0, /* ts6 */
1, /* support helper umode */
},
{NULL}
};
@@ -1344,10 +1346,9 @@ void anope_cmd_bot_chan_mode(char *nick, char *chan)
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1686,7 +1687,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+1880
View File
File diff suppressed because it is too large Load Diff
+48 -2
View File
@@ -18,6 +18,8 @@ Server *servlist = NULL;
Server *me_server = NULL;
uint32 uplink_capab;
char *uplink;
char *TS6UPLINK;
char *TS6SID;
/* For first_server / next_server */
static Server *server_cur;
@@ -96,7 +98,7 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
serv->desc = sstrdup(desc);
serv->flags = flags;
serv->uplink = uplink;
serv->suid = suid;
serv->suid = sstrdup(suid);
serv->sync = -1;
serv->links = NULL;
serv->prev = NULL;
@@ -235,6 +237,43 @@ Server *findserver(Server * s, const char *name)
/*************************************************************************/
/**
* Find a server by UID, returns NULL if not found
* @param s Server struct
* @param name Server Name
* @return Server struct
*/
Server *findserver_uid(Server * s, const char *name)
{
Server *sl;
if (!name || !*name) {
return NULL;
}
if (debug >= 3) {
alog("debug: findserver_uid(%p)", name);
}
while (s && s->suid && (stricmp(s->suid, name) != 0)) {
if (s->links) {
sl = findserver_uid(s->links, name);
if (sl) {
s = sl;
} else {
s = s->next;
}
} else {
s = s->next;
}
}
if (debug >= 3) {
alog("debug: findserver_uid(%s) -> %p", name, (void *) s);
}
return s;
}
/*************************************************************************/
/**
* Find if the server is synced with the network
* @param s Server struct
@@ -303,7 +342,14 @@ void do_squit(const char *source, int ac, char **av)
char buf[BUFSIZE];
Server *s;
s = findserver(servlist, av[0]);
if (UseTS6 && ircd->ts6) {
s = findserver_uid(servlist, av[0]);
if (!s) {
s = findserver(servlist, av[0]);
}
} else {
s = findserver(servlist, av[0]);
}
if (!s) {
alog("SQUIT for nonexistent server (%s)!!", av[0]);
return;
+5 -4
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
"x", /* vhost char */
0, /* ts6 */
1, /* support helper umode */
}
,
{NULL}
@@ -1286,10 +1288,9 @@ int anope_event_motd(char *source, int ac, char **av)
/* EVENT: SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1745,7 +1746,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+5 -4
View File
@@ -105,6 +105,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
1, /* Sglines are enforced */
"x", /* vhost char */
0, /* ts6 */
1, /* support helper umode */
},
{NULL}
};
@@ -988,10 +990,9 @@ int anope_event_chgident(char *source, int ac, char **av)
/* EVENT: SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1823,7 +1824,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+5 -4
View File
@@ -106,6 +106,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
"x", /* vhost char */
0, /* ts6 */
1, /* support helper umode */
},
{NULL}
};
@@ -1384,10 +1386,9 @@ int anope_event_chghost(char *source, int ac, char **av)
/* EVENT: SERVER */
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1"))
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
do_server(source, av[0], av[1], av[2], NULL);
return MOD_CONT;
}
@@ -1610,7 +1611,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+2
View File
@@ -105,6 +105,8 @@ IRCDVar ircd[] = {
1, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
"x", /* vhost char */
0, /* ts6 */
1, /* support helper umode */
},
{NULL}
};
+104 -1
View File
@@ -17,6 +17,9 @@
#define HASH(nick) (((nick)[0]&31)<<5 | ((nick)[1]&31))
User *userlist[1024];
#define HASH2(nick) (((nick)[0]&31)<<5 | ((nick)[1]&31))
Uid *uidlist[1024];
int32 usercnt = 0, opcnt = 0;
uint32 maxusercnt = 0;
time_t maxusertime;
@@ -222,6 +225,9 @@ void delete_user(User * user)
free(user->vhost);
}
}
if (user->uid) {
free(user->uid);
}
Anope_Free(user->realname);
if (debug >= 2) {
alog("debug: delete_user(): remove from channels");
@@ -363,6 +369,99 @@ User *nextuser(void)
return current;
}
User *find_byuid(const char *uid)
{
User *u, *next;
u = first_uid();
while (u) {
next = next_uid();
if (!stricmp(uid, u->uid)) {
return u;
}
u = next;
}
return NULL;
}
User *first_uid(void)
{
next_index = 0;
while (next_index < 1024 && current == NULL) {
current = userlist[next_index++];
}
if (debug >= 2) {
alog("debug: first_uid() returning %s %s",
current ? current->nick : "NULL (end of list)",
current ? current->uid : "");
}
return current;
}
User *next_uid(void)
{
if (current)
current = current->next;
if (!current && next_index < 1024) {
while (next_index < 1024 && current == NULL)
current = userlist[next_index++];
}
if (debug >= 2) {
alog("debug: next_uid() returning %s %s",
current ? current->nick : "NULL (end of list)",
current ? current->uid : "");
}
return current;
}
Uid *new_uid(const char *nick, char *uid)
{
Uid *u, **list;
u = scalloc(sizeof(Uid), 1);
if (!nick || !uid) {
return NULL;
}
strscpy(u->nick, nick, NICKMAX);
list = &uidlist[HASH2(u->nick)];
u->next = *list;
if (*list)
(*list)->prev = u;
*list = u;
u->uid = sstrdup(uid);
return u;
}
Uid *find_uid(const char *nick)
{
Uid *u;
int i;
for (i = 0; i < 1024; i++) {
for (u = uidlist[i]; u; u = u->next) {
if (!stricmp(nick, u->nick)) {
return u;
}
}
}
return NULL;
}
Uid *find_nickuid(const char *uid)
{
Uid *u;
int i;
for (i = 0; i < 1024; i++) {
for (u = uidlist[i]; u; u = u->next) {
if (!stricmp(uid, u->uid)) {
return u;
}
}
}
return NULL;
}
/*************************************************************************/
/*************************************************************************/
@@ -509,7 +608,11 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
user->timestamp = ts;
user->my_signon = time(NULL);
user->vhost = vhost ? sstrdup(vhost) : sstrdup(host);
user->uid = uid; /* p10 stuff */
if (uid) {
user->uid = sstrdup(uid); /* p10/ts6 stuff */
} else {
user->uid = NULL;
}
user->vident = sstrdup(username);
if (CheckClones) {
+3 -3
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
"x", /* vhost char */
0, /* ts6 */
1, /* support helper umode */
}
,
{NULL}
@@ -1038,8 +1040,6 @@ int anope_event_cs(char *source, int ac, char **av)
int anope_event_server(char *source, int ac, char **av)
{
char *uplink;
if (!stricmp(av[1], "1")) {
uplink = sstrdup(av[0]);
}
@@ -1732,7 +1732,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
s = normalizeBuffer(buf);
}
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
}
#endif
+5 -1
View File
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="7"
VERSION_BUILD="554"
VERSION_BUILD="555"
# $Log$
#
# BUILD : 1.7.7 (555)
# BUGS : N/A
# NOTES : TS6 support, Ratbox support, lots of little bug fixes, updated documentation
#
# BUILD : 1.7.7 (554)
# BUGS : none
# NOTES : Updated pt.l by Ricardo.