Browse Source

Big 3.4.x commit containing bug fixes and enhancements. Modularizing

user & channel modes. Fixing Windows build. Etc..
Bram Matthys 9 years ago
parent
commit
101d2dd6a3
  1. 2
      .CHANGES.NEW
  2. 93
      .RELEASE.NOTES
  3. 2
      .hgignore
  4. 4
      Makefile.in
  5. 4
      Unreal.nfo
  6. 30
      configure
  7. 12
      configure.ac
  8. 6
      doc/compiling_win32.txt
  9. 7
      doc/example.conf
  10. 1
      doc/technical/serverprotocol.html
  11. 3
      doc/technical/vl.txt
  12. 4
      doc/unreal32docs.de.html
  13. 4
      doc/unreal32docs.es.html
  14. 4
      doc/unreal32docs.fr.html
  15. 4
      doc/unreal32docs.html
  16. 4
      doc/unreal32docs.hu.html
  17. 4
      doc/unreal32docs.ru.html
  18. 4
      doc/unreal32docs.tr.html
  19. 20
      include/badwords.h
  20. 11
      include/common.h
  21. 34
      include/config.h
  22. 7
      include/dynconf.h
  23. 2
      include/fdlist.h
  24. 64
      include/h.h
  25. 75
      include/list.h
  26. 4
      include/mempool.h
  27. 94
      include/modules.h
  28. 9
      include/modversion.h
  29. 55
      include/proto.h
  30. 90
      include/struct.h
  31. 2
      include/sys.h
  32. 4
      include/version.h
  33. 2
      include/win32/setup.h
  34. 3
      m_template.c
  35. 116
      makefile.win32
  36. 26
      modules.conf
  37. 15
      src/Makefile
  38. 1
      src/api-isupport.c
  39. 459
      src/channel.c
  40. 5
      src/charsys.c
  41. 2
      src/dbuf.c
  42. 11
      src/events.c
  43. 2
      src/extbans.c
  44. 360
      src/extcmodes.c
  45. 25
      src/fdlist.c
  46. 214
      src/ircd.c
  47. 20
      src/ircsprintf.c
  48. 164
      src/list.c
  49. 30
      src/mempool.c
  50. 55
      src/modules.c
  51. 46
      src/modules/Makefile.in
  52. 32
      src/modules/cap_invitenotify.c
  53. 90
      src/modules/chanmodes/Makefile.in
  54. 661
      src/modules/chanmodes/censor.c
  55. 1300
      src/modules/chanmodes/floodprot.c
  56. 23
      src/modules/chanmodes/issecure.c
  57. 500
      src/modules/chanmodes/jointhrottle.c
  58. 214
      src/modules/chanmodes/link.c
  59. 148
      src/modules/chanmodes/nocolor.c
  60. 115
      src/modules/chanmodes/noctcp.c
  61. 30
      src/modules/chanmodes/permanent.c
  62. 130
      src/modules/chanmodes/stripcolor.c
  63. 608
      src/modules/l_commands.c
  64. 3
      src/modules/m_addline.c
  65. 3
      src/modules/m_addmotd.c
  66. 3
      src/modules/m_addomotd.c
  67. 3
      src/modules/m_admin.c
  68. 3
      src/modules/m_adminchat.c
  69. 3
      src/modules/m_away.c
  70. 3
      src/modules/m_botmotd.c
  71. 61
      src/modules/m_cap.c
  72. 3
      src/modules/m_chatops.c
  73. 7
      src/modules/m_chghost.c
  74. 7
      src/modules/m_chgident.c
  75. 3
      src/modules/m_chgname.c
  76. 3
      src/modules/m_chmodetst.c
  77. 3
      src/modules/m_close.c
  78. 3
      src/modules/m_connect.c
  79. 3
      src/modules/m_cycle.c
  80. 3
      src/modules/m_dccallow.c
  81. 3
      src/modules/m_dccdeny.c
  82. 3
      src/modules/m_dummy.c
  83. 3
      src/modules/m_eos.c
  84. 3
      src/modules/m_globops.c
  85. 3
      src/modules/m_guest.c
  86. 3
      src/modules/m_help.c
  87. 3
      src/modules/m_invite.c
  88. 3
      src/modules/m_ison.c
  89. 199
      src/modules/m_join.c
  90. 38
      src/modules/m_kick.c
  91. 3
      src/modules/m_kill.c
  92. 8
      src/modules/m_knock.c
  93. 3
      src/modules/m_lag.c
  94. 3
      src/modules/m_links.c
  95. 3
      src/modules/m_list.c
  96. 3
      src/modules/m_locops.c
  97. 5
      src/modules/m_lusers.c
  98. 3
      src/modules/m_map.c
  99. 378
      src/modules/m_message.c
  100. 3
      src/modules/m_mkpasswd.c
  101. Some files were not shown because too many files have changed in this diff Show More

2
.CHANGES.NEW

@ -7,7 +7,7 @@
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for Unreal3.4-dev
for Unreal3.4-alpha0
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.

93
.RELEASE.NOTES

@ -1,52 +1,91 @@
Unreal3.4-dev Release Notes
===========================
Unreal3.4-alpha0 Release Notes
===============================
This will be the first alpha version of UnrealIRCd 3.4.
Some important remarks:
* This version is NOT STABLE and since this is the very first alpha release
it will probably CRASH or hang from time to time. Security issues are also
more likely in this 3.4-alpha series.
DO NOT EVEN THINK ABOUT USING THIS ON ANY SERIOUS (PRODUCTION) SERVER!!
Use this alpha version to play around with the latest features and
improvements, test them, and give us feedback(!) on bugs.unrealircd.org
and/or on the forums.
* Linking of 3.2 <-> 3.4 is supported. However, because this is such an
early alpha version we can make no guarantees about the impact of this 3.4
server on the rest of the net. At this point WE DO NOT RECOMMEND LINKING
3.4-alpha* to a 3.2 PRODUCTION/LIVE NETWORK.
* Things are likely to change between alpha versions. Including configuration,
commands, etc. You should not make any assumptions as long as 3.4 is in
alpha stage.
* If you are moving from 3.2.x then be sure to read 'CONFIGURATION CHANGES'!
==[ GENERAL INFORMATION ]==
- If you are upgrading on *NIX, then make sure you run 'make clean' and
'./Config' first, before running 'make'.
- The official UnrealIRCd documentation is doc/unreal32docs.html
online version at: http://www.vulnscan.org/UnrealIRCd/unreal32docs.html
FAQ: http://www.vulnscan.org/UnrealIRCd/faq/
* The official UnrealIRCd documentation for 3.4 is currently not up to date.
Translations have not been updated at all, don't use them for now!
The online version is available at www.unrealircd.com/unreal32docs.html
FAQ: http://www.unrealircd.com/faq
Read them before asking for help.
- Report bugs at http://bugs.unrealircd.org/
- The purpose of the sections below (NEW, CHANGED, MINOR, etc) is to be a
* Report bugs at http://bugs.unrealircd.org/
* The purpose of the sections below (NEW, CHANGED, MINOR, etc) is to be a
SUMMARY of the changes in this release. There have been many changes in
total, for the full list of changes see the Changelog.
==[ CONFIGURATION CHANGES ]==
* In your me { } block, change your "numeric" to "sid", and change the
value as follows: pick a 3 character Server ID that starts with a digit.
For example: sid "001";
* For loadmodule lines you can (and should) now use the shorter syntax.
Instead of:
loadmodule "src/modules/cloaks.so";
You should now use:
loadmodule "modules/cloak";
UnrealIRCd will figure out the exact name of the module. Doesn't matter
if you are on Windows or *NIX, and if your modules are in src/modules/ or
in modules/.
* The commands module is gone and replaced with many individual modules:
1) Remove the loadmodule line for commands.so
2) Add the following line to your unrealircd.conf:
include "modules.conf";
==[ NEW ]==
- Entirely rewritten I/O and event loop. This allows the IRCd to scale to
tens of thousands of clients on a single process using kernel-evented I/O
* Entirely rewritten I/O and event loop. This allows the IRCd to scale
more easily to tens of thousands of clients by using kernel-evented I/O
mechanisms such as epoll and kqueue.
- Full command modularity is now provided by default. Each command is it's
own module and all of them are loaded in the default config. See modules.conf.
- The local nickname length can be modified without recompiling the IRCd, the
compiled limit is displayed as MAXNICKLEN, per IRCv3 group discussions.
- Memory pooling has been added to improve memory allocation efficiency on
'hot' codepaths.
* Memory pooling has been added to improve memory allocation efficiency
and performance.
* The local nickname length can be modified without recompiling the IRCd
==[ CHANGED ]==
- Numerics have been removed. You will need to remove the numeric setting
from me {} in unrealircd.conf. Instead, proper SID and UIDs are implemented.
See me::sid.
* Numerics have been removed. Instead we now use SIDs (Server ID's) and
UIDs (User ID's). SIDs work very similar to server numerics and UIDs
help us to fix a number of lag-related race conditions / bugs.
* The module commands.so / commands.dll has been removed. All commands
(those that are modular) are now in their own module.
* We are in the process of moving channel and user modes to individual
modules. All usual modes are included in modules.conf by default but
you can decide not to load some of them, simply by commenting them out.
Not only does this provide more customizability, it also makes it much
easier for developers to look at all the code for a particular feature.
==[ MAJOR BUGS FIXED ]==
- None?
* None?
==[ MINOR BUGS FIXED ]==
- None?
* None?
==[ REMOVED / DROPPED ]==
- Numeric server IDs, see above.
- PROTOCTL TOKEN and SJB64 are no longer implemented.
- Ziplinks -- use the built-in compression of TLS/SSL instead.
* Numeric server IDs, see above.
* PROTOCTL TOKEN and SJB64 are no longer implemented.
* Ziplinks have been removed. We recommend to use SSL/TLS for all server
connections. SSL/TSL already includes compression (when available).
==[ KNOWN ISSUES ]==
- Regexes: Be careful with backreferences (\1, etc), certain regexes can
* Regexes: Be careful with backreferences (\1, etc), certain regexes can
slow the IRCd down considerably and even bring it to a near-halt.
In the spamfilter user target it's usually safe though.
Slow spamfilter detection can help prevent the slowdown/freeze, but
might not work in worst-case scenario's.
- Regexes: Possessive quantifiers such as, for example, "++" (not to be
* Regexes: Possessive quantifiers such as, for example, "++" (not to be
confused with "+") are not safe to use, they can easily freeze the IRCd.
==[ ADDITIONAL INFO ]==

2
.hgignore

@ -14,6 +14,8 @@ syntax: regexp
# autotools
^config\.(status|log)$
^autom4te.cache
^aclocal\.m4$
# not quite autotools
^config\.settings$

4
Makefile.in

@ -20,7 +20,7 @@
#*/
CC=@CC@
INCLUDEDIR=../include
INCLUDEDIR=@UNRLINCDIR@
NETWORKSDIR=
FROMDOS=/home/cmunk/bin/4dos
@ -218,7 +218,7 @@ install: all
$(INSTALL) -m 0700 -d $(IRCDDIR)/aliases
$(INSTALL) -m 0600 aliases/*.conf $(IRCDDIR)/aliases
$(INSTALL) -m 0600 doc/example.conf $(IRCDDIR)/unrealircd.conf
$(INSTALL) -m 0600 spamfilter.conf dccallow.conf $(IRCDDIR)
$(INSTALL) -m 0600 spamfilter.conf dccallow.conf modules.conf $(IRCDDIR)
$(INSTALL) -m 0600 badwords.*.conf help.conf LICENSE Donation $(IRCDDIR)
$(INSTALL) -m 0700 unreal $(IRCDDIR)
$(INSTALL) -m 0700 -d $(IRCDDIR)/modules

4
Unreal.nfo

@ -1,5 +1,5 @@
===============================================
= UnrealIRCd v3.2.4-dev1 =
= UnrealIRCd v3.4-alpha0 =
===============================================
This release was brought to you by:
@ -10,7 +10,6 @@
Coders:
========
* binki
* nenolod
Contributors:
=============
@ -20,6 +19,7 @@
================
* Stskeeps
* codemastr
* nenolod
* Many more..
Internet Presence:

30
configure vendored

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for unrealircd 3.4-dev.
# Generated by GNU Autoconf 2.69 for unrealircd 3.4-alpha0.
#
# Report bugs to <http://bugs.unrealircd.org/>.
#
@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='unrealircd'
PACKAGE_TARNAME='unrealircd'
PACKAGE_VERSION='3.4-dev'
PACKAGE_STRING='unrealircd 3.4-dev'
PACKAGE_VERSION='3.4-alpha0'
PACKAGE_STRING='unrealircd 3.4-alpha0'
PACKAGE_BUGREPORT='http://bugs.unrealircd.org/'
PACKAGE_URL='http://unrealircd.org/'
@ -624,6 +624,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
UNRLINCDIR
URL
CARES_LIBS
CARES_CFLAGS
@ -1278,7 +1279,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures unrealircd 3.4-dev to adapt to many kinds of systems.
\`configure' configures unrealircd 3.4-alpha0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1339,7 +1340,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of unrealircd 3.4-dev:";;
short | recursive ) echo "Configuration of unrealircd 3.4-alpha0:";;
esac
cat <<\_ACEOF
@ -1472,7 +1473,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
unrealircd configure 3.4-dev
unrealircd configure 3.4-alpha0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2078,7 +2079,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by unrealircd $as_me 3.4-dev, which was
It was created by unrealircd $as_me 3.4-alpha0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3327,6 +3328,10 @@ fi
fi
case "`$CC -v --help 2>&1`" in
*-fstrict-aliasing* ) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
esac
case "`$CC -v --help 2>&1`" in
*-Wpointer-sign* ) CFLAGS="$CFLAGS -Wno-pointer-sign" ;;
esac
@ -7073,7 +7078,10 @@ rm -f core conftest.err conftest.$ac_objext \
fi
ac_config_files="$ac_config_files Makefile src/modules/Makefile unreal ircdcron/ircdchk ircdcron/ircd.cron"
UNRLINCDIR="`pwd`/include"
ac_config_files="$ac_config_files Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile unreal ircdcron/ircdchk ircdcron/ircd.cron"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -7581,7 +7589,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by unrealircd $as_me 3.4-dev, which was
This file was extended by unrealircd $as_me 3.4-alpha0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -7644,7 +7652,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
unrealircd config.status 3.4-dev
unrealircd config.status 3.4-alpha0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@ -7768,6 +7776,8 @@ do
"include/setup.h") CONFIG_HEADERS="$CONFIG_HEADERS include/setup.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;;
"src/modules/chanmodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/chanmodes/Makefile" ;;
"src/modules/usermodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/usermodes/Makefile" ;;
"unreal") CONFIG_FILES="$CONFIG_FILES unreal" ;;
"ircdcron/ircdchk") CONFIG_FILES="$CONFIG_FILES ircdcron/ircdchk" ;;
"ircdcron/ircd.cron") CONFIG_FILES="$CONFIG_FILES ircdcron/ircd.cron" ;;

12
configure.ac

@ -10,7 +10,7 @@ dnl Unreal.nfo
dnl .CHANGES.NEW
dnl src/version.c.SH
AC_INIT([unrealircd], [3.4-dev], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/])
AC_INIT([unrealircd], [3.4-alpha0], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/])
AC_CONFIG_SRCDIR([src/ircd.c])
AC_CONFIG_HEADER([include/setup.h])
AC_CONFIG_AUX_DIR([autoconf])
@ -56,6 +56,11 @@ fi
dnl (the gcc flag detection trick is taken from xemacs/Vin Shelton)
dnl UnrealIRCd might not be strict-aliasing safe at this time
case "`$CC -v --help 2>&1`" in
*-fstrict-aliasing* ) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
esac
dnl Pointer signedness warnings are really a pain and 99.9% of the time
dnl they are of absolutely no use whatsoever. IMO the person who decided
dnl to enable this without -Wall should be shot on sight.
@ -673,8 +678,13 @@ PKG_CHECK_MODULES([CARES], libcares >= 1.6.0)
CHECK_LIBCURL
UNRLINCDIR="`pwd`/include"
AC_SUBST(UNRLINCDIR)
AC_CONFIG_FILES([Makefile
src/modules/Makefile
src/modules/chanmodes/Makefile
src/modules/usermodes/Makefile
unreal
ircdcron/ircdchk
ircdcron/ircd.cron])

6
doc/compiling_win32.txt

@ -94,9 +94,9 @@ So, again, it will NOT work properly, if:
==[ SYMBOL FILES ]==
If you get something like this:
Creating library L_COMMANDS.lib and object L_COMMANDS.exp
M_OPER.obj : error LNK2019: unresolved external symbol _sendto_snomask_global re
ferenced in function _m_oper
Creating library ....
M_OPER.obj : error LNK2019: unresolved external symbol _sendto_snomask_global
referenced in function _m_oper
(note: the exact name of the symbol will vary!)

7
doc/example.conf

@ -56,15 +56,14 @@ include "spamfilter.conf";
* info "Server Description";
* sid "server id";
* };
* The server ID must begin with a number and have two additional numbers or letters
* afterward.
* If linking, the server ID may not be used by any other server on the network.
* The server ID (sid) must begin with a number, followed by two additional num-
* bers or letters. When linking, the server ID must be unique on the network.
*/
me
{
name "irc.foonet.com";
info "FooNet Server";
sid "0AA";
sid "001";
};
/*

1
doc/technical/serverprotocol.html

@ -141,7 +141,6 @@
<li>W : Windows IRCd.</li>
<li>Y : Syslog logging enabled.</li>
<li>6 : Server has IPv6 support (#define INET6 or answer "yes" to relevant ./Config prompt).</li>
<li>X : Server has badword stripping (user and channel modes +G) (#define STRIPBADWORDS).</li>
<li>P : Server is using poll().</li>
<li>e : Server has SSL Support (#define USE_SSL or answer "yes" (and have ssl libraries installed) to relevant ./Config prompt).</li>
<li>O : Server has OperOverride enabled (#undef NO_OPEROVERRIDE or answer "no" to relevant ./Config prompt).</li>

3
doc/technical/vl.txt

@ -2,7 +2,7 @@ VL Information (c) 2002 codemastr (Dominick Meglio) [codemastr@unrealircd.com]
Protocol Version
------------------------------------------------------------------------------------------------
2312 3.4-alpha*
2350 3.4-alpha*
2311 3.2.10
2310 3.2.9
2309 3.2.6, 3.2.7, 3.2.8
@ -30,7 +30,6 @@ W Windows version
Y Syslog logging enabled
K No ident checking (?)
6 IPv6 supported
X STRIPBADWORDS enabled (chmode/umode +G)
P Uses poll()
e SSL supported
O OperOverride enabled

4
doc/unreal32docs.de.html

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UnrealIRCd - 3.2 - Offical Documentation</title>
<title>UnrealIRCd - 3.4 - Offical Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.block_section { font-size: 24; font-weight: bold; }
@ -27,7 +27,7 @@
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
<font size="4">Version: 3.2.10-rc1</font><br>
<font size="4">Version: 3.4-alpha0</font><br>
<b>Letztes Update dieses Handbuchs:</b> 2009-12-24</div>
<b>Head Coders:</b> Stskeeps / codemastr / Syzop / Luke<font face="Helvetica,Arial" size="-1">/
aquanight / WolfSage</font><br>

4
doc/unreal32docs.es.html

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UnrealIRCd - 3.2 - Documentacion Oficial</title>
<title>UnrealIRCd - 3.4 - Documentacion Oficial</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.block_section { font-size: 24; font-weight: bold; }
@ -30,7 +30,7 @@ Spanish
<br><br>
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
<font size="4">Version: 3.2.10</font><br>
<font size="4">Version: 3.4-alpha0</font><br>
<b>Ultima actualizacion del doc:</b> 2012-11-11</div>
<br>
<b>Programador jefe/mantenimiento:</b> Syzop<br>

4
doc/unreal32docs.fr.html

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UnrealIRCd - 3.2 - Documentation officielle</title>
<title>UnrealIRCd - 3.4 - Documentation officielle</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.block_section { font-size: 24; font-weight: bold; }
@ -33,7 +33,7 @@
<div style="text-align:center;">
<b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com/">http://www.unrealircd.com</a></font><br>
<font size="4">Version: 3.2.10</font><br>
<font size="4">Version: 3.4-alpha0</font><br>
<b>Dernière mise à jour de la documentation:</b> 2012-10-16
</div>

4
doc/unreal32docs.html

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UnrealIRCd - 3.2 - Official Documentation</title>
<title>UnrealIRCd - 3.4 - Official Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.block_section { font-size: 24; font-weight: bold; }
@ -30,7 +30,7 @@ English |
<br><br>
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
<font size="4">Version: 3.2.10</font><br>
<font size="4">Version: 3.4-alpha0</font><br>
<b>Last doc update:</b> 2012-10-16</div>
<br>
<b>Head coder/maintainer:</b> Syzop<br>

4
doc/unreal32docs.hu.html

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UnrealIRCd - 3.2 - Hivatalos dokumentáció</title>
<title>UnrealIRCd - 3.4 - Hivatalos dokumentáció</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css">
.block_section { font-size: 24; font-weight: bold; }
@ -29,7 +29,7 @@ Hungarian |
<br><br>
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com/">http://www.unrealircd.com</a></font><br>
<font size="4">Verzió: 3.2.10-rc1</font><br>
<font size="4">Verzió: 3.4-alpha0</font><br>
<b>Utolsó dokumentáció frissítés:</b> 2010-11-15</div>
<br>
<b>Fõ fejlesztõ/karbantartó:</b> Syzop<br>

4
doc/unreal32docs.ru.html

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UnrealIRCd - 3.2 - Îôèöèàëüíàÿ äîêóìåíòàöèÿ</title>
<title>UnrealIRCd - 3.4 - Îôèöèàëüíàÿ äîêóìåíòàöèÿ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style type="text/css"> .block_section { font-size: 24; font-weight: bold; }
.block_name { font-size: 24; font-weight: bold; }
@ -28,7 +28,7 @@
<br>
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
<font size="4">Âåðñèÿ: 3.2.10</font><br>
<font size="4">Âåðñèÿ: 3.4-alpha0</font><br>
<b>Ïîñëåäíåå îáíîâëåíèå:</b> 2012-10-18</div>
<br>
<b>Ãëàâíûå ïðîãðàììèñòû</b> Syzop<br>

4
doc/unreal32docs.tr.html

@ -1,5 +1,5 @@
<div class="moz-text-flowed" style="font-family: -moz-fixed"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>UnrealIRCd - 3.2 - Resmi Döküman</TITLE>
<HTML><HEAD><TITLE>UnrealIRCd - 3.4 - Resmi Döküman</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-9">
<STYLE type=text/css>.block_section {
FONT-WEIGHT: bold; FONT-SIZE: 24px
@ -46,7 +46,7 @@ Turkish |
<BR><BR>
<DIV align=center><B><FONT size=7>UnrealIRCd</FONT></B><BR><FONT size=4><A
href="http://www.unrealircd.com/">http://www.unrealircd.com/</A></FONT><BR><FONT
size=4>Version: 3.2.10</FONT><BR><B>En Son Güncelleme:</B>
size=4>Version: 3.4-alpha0</FONT><BR><B>En Son Güncelleme:</B>
2012-10-16</DIV><BR>
<B>Baþ Kodlayýcý/Devam Ettiren:</b> Syzop<br>
<b>Kodlayýcýlar:</b> binki<br>

20
include/badwords.h

@ -13,4 +13,24 @@
#define PATTERN "\\w*%s\\w*"
#define REPLACEWORD "<censored>"
#define BADW_TYPE_INVALID 0x0
#define BADW_TYPE_FAST 0x1
#define BADW_TYPE_FAST_L 0x2
#define BADW_TYPE_FAST_R 0x4
#define BADW_TYPE_REGEX 0x8
#define BADWORD_REPLACE 1
#define BADWORD_BLOCK 2
typedef struct _configitem_badword ConfigItem_badword;
struct _configitem_badword {
ConfigItem_badword *prev, *next;
ConfigFlag flag;
char *word, *replace;
unsigned short type;
char action;
regex_t expr;
};
#endif

11
include/common.h

@ -41,7 +41,13 @@
#ifdef PARAMH
#include <sys/param.h>
#endif
#ifndef _WIN32
#include <stdbool.h>
#else
typedef int bool;
#define false 0
#define true 1
#endif
#if !defined(IN_ADDR)
#include "sys.h"
@ -231,6 +237,9 @@ static char *StsMalloc(size_t size, char *file, long line)
#endif
#define ircstrdup(x,y) do { if (x) MyFree(x); if (!y) x = NULL; else x = strdup(y); } while(0)
#define ircfree(x) do { if (x) MyFree(x); x = NULL; } while(0)
extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
/*
@ -253,7 +262,7 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
#define CHPAR1 "beIqa"
#endif /* PREFIX_AQ */
#define CHPAR2 "kfL"
#define CHPAR2 "k"
#define CHPAR3 "l"
#define CHPAR4 "psmntirRcOAQKVCuzNSM"

34
include/config.h

@ -149,16 +149,6 @@
*/
#define REMOTEINC_SPECIALCACHE
/*
Stripbadwords patch
*/
#define STRIPBADWORDS
/*
* Always strip badwords in channels? (channel does not have to be +G)
*/
#undef STRIPBADWORDS_CHAN_ALWAYS
/*
* No spoof code
*
@ -264,18 +254,17 @@
/* CHROOTDIR
*
* This enables running the IRCd chrooted (requires initial root privileges,
* but will be dropped to IRC_USER/IRC_GROUP privileges if those are defined).
* This enables running the IRCd chrooted. Privileges will be dropped later
* to IRC_USER/IRC_GROUP when those are defined.
*
* The directory to chroot to is simply DPATH (which is set via ./Config).
* (This may effect the PATH locations above, though you can symlink it)
*
* Usually you only simply need to enable this, and set IRC_USER and
* IRC_GROUP, you don't need to create a special chroot environment..
* If you want this, simple change this to '#define CHROOTDIR' and also
* look at IRC_USER/IRC_GROUP a few lines below.
* There's no need for you to create a special chroot environment;
* UnrealIRCd will do that by itself (Unreal will create /dev/random,
* etc. etc.).
*
* Change to '#define CHROOTDIR' to enable...
*/
/* #define CHROOTDIR */
@ -283,8 +272,7 @@
* IRC_USER
*
* If you start the server as root but wish to have it run as another user,
* define IRC_USER to that user name. This should only be defined if you
* are running as root and even then perhaps not.
* define IRC_USER to that user name.
*/
/* #define IRC_USER "<user name>" */
/* #define IRC_GROUP "<group name>" */
@ -464,13 +452,11 @@
*/
#define KILLCHASETIMELIMIT 90 /* Recommended value: 90 */
/* JoinThrottle (chanmode +j): +j x:y throttles users to X joins per Y seconds (per-user).
* In peak situations (eg: just after a server restart with thousand clients joining
* hundreds of channels) it can use like ~200k, but in normal circumstances you should
* count on just ~10-50k.
/*
* Forces Unreal to use compressed IPv6 addresses rather than expanding them
*/
#define JOINTHROTTLE
#undef IPV6_COMPRESSED
/* Detect slow spamfilters? This requires a little more cpu time when processing
* any spamfilter (like on text/connect/..) but will save you from slowing down
* your IRCd to a near-halt (well, in most cases.. there are still cases like when

7
include/dynconf.h

@ -51,7 +51,6 @@ struct ChMode {
long mode;
long extmodes;
char *extparams[EXTCMODETABLESZ];
ChanFloodProt floodprot;
};
typedef struct _OperStat {
@ -110,9 +109,9 @@ struct zConfiguration {
int ssl_renegotiate_timeout;
#elif defined(_WIN32)
void *bogus1, *bogus2, *bogus3, *bogus5, *bogus8;
long bogus4;
int bogus6, bogus7;
void *bogus1, *bogus2, *bogus3, *bogus4, *bogus5;
long bogus6;
int bogus7, bogus8;
#endif
enum UHAllowed userhost_allowed;
char *restrict_usermodes;

2
include/fdlist.h

@ -24,6 +24,7 @@ extern MODVAR FDEntry fd_table[MAXCONNECTIONS + 1];
extern int fd_open(int fd, const char *desc);
extern void fd_close(int fd);
extern void fd_unnotify(int fd);
extern int fd_socket(int family, int type, int protocol, const char *desc);
extern int fd_accept(int sockfd);
extern void fd_desc(int fd, const char *desc);
@ -32,6 +33,7 @@ extern int fd_fileopen(const char *path, unsigned int flags);
#define FD_SELECT_READ 0x1
#define FD_SELECT_WRITE 0x2
#define FD_SELECT_ONESHOT 0x4
#define FD_SELECT_NOWRITE 0x8
extern void fd_setselect(int fd, int flags, IOCallbackFunc iocb, void *data);
extern void fd_select(time_t delay); /* backend-specific */

64
include/h.h

@ -69,9 +69,6 @@ extern MODVAR ConfigItem_except *conf_except;
extern MODVAR ConfigItem_vhost *conf_vhost;
extern MODVAR ConfigItem_link *conf_link;
extern MODVAR ConfigItem_ban *conf_ban;
extern MODVAR ConfigItem_badword *conf_badword_channel;
extern MODVAR ConfigItem_badword *conf_badword_message;
extern MODVAR ConfigItem_badword *conf_badword_quit;
extern MODVAR ConfigItem_deny_dcc *conf_deny_dcc;
extern MODVAR ConfigItem_deny_channel *conf_deny_channel;
extern MODVAR ConfigItem_deny_link *conf_deny_link;
@ -93,7 +90,15 @@ extern long set_usermode(char *umode);
extern char *get_modestr(long umodes);
extern void config_error(char *format, ...) __attribute__((format(printf,1,2)));
extern void config_warn(char *format, ...) __attribute__((format(printf,1,2)));
extern void config_error_missing(const char *filename, int line, const char *entry);
extern void config_error_unknown(const char *filename, int line, const char *block, const char *entry);
extern void config_error_unknownflag(const char *filename, int line, const char *block, const char *entry);
extern void config_error_unknownopt(const char *filename, int line, const char *block, const char *entry);
extern void config_error_noname(const char *filename, int line, const char *block);
extern void config_error_blank(const char *filename, int line, const char *block);
extern void config_error_empty(const char *filename, int line, const char *block, const char *entry);
extern void config_warn_duplicate(const char *filename, int line, const char *entry);
extern int config_is_blankorempty(ConfigEntry *cep, const char *block);
extern MODVAR int config_verbose;
extern void config_progress(char *format, ...) __attribute__((format(printf,1,2)));
extern void ipport_seperate(char *string, char **ip, char **port);
@ -298,7 +303,6 @@ extern void sendto_server(aClient *one, unsigned long caps, unsigned long nocaps
extern MODVAR int writecalls, writeb[];
extern int deliver_it(aClient *, char *, int);
extern int check_for_chan_flood(aClient *cptr, aClient *sptr, aChannel *chptr);
extern int check_for_target_limit(aClient *sptr, void *target, const char *name);
extern char *canonize(char *buffer);
extern ConfigItem_deny_dcc *dcc_isforbidden(aClient *sptr, char *filename);
@ -412,9 +416,7 @@ extern MODVAR long UMODE_VICTIM; /* 0x8000000 Intentional Victim */
extern MODVAR long UMODE_DEAF; /* 0x10000000 Deaf */
extern MODVAR long UMODE_HIDEOPER; /* 0x20000000 Hide oper mode */
extern MODVAR long UMODE_SETHOST; /* 0x40000000 used sethost */
extern MODVAR long UMODE_STRIPBADWORDS; /* 0x80000000 */
extern MODVAR long UMODE_HIDEWHOIS; /* hides channels in /whois */
extern MODVAR long UMODE_NOCTCP; /* blocks all ctcp (except dcc and action) */
extern MODVAR long UMODE_HIDLE; /* hides oper idle times */
extern MODVAR long AllUmodes, SendUmodes;
@ -435,10 +437,6 @@ extern MODVAR long SNO_OPER;
/* Extended chanmodes... */
extern MODVAR Cmode_t EXTMODE_NONOTICE;
#ifdef STRIPBADWORDS
extern MODVAR Cmode_t EXTMODE_STRIPBADWORDS;
#endif
extern MODVAR Cmode_t EXTMODE_JOINTHROTTLE;
#ifndef HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t size);
@ -538,7 +536,6 @@ extern void validate_configuration(void);
extern void run_configuration(void);
extern void rehash_motdrules();
extern void read_motd(const char *filename, aMotdFile *motd); /* s_serv.c */
extern CMD_FUNC(m_server_remote);
extern void send_proto(aClient *, ConfigItem_link *);
extern void unload_all_modules(void);
extern int set_blocking(int fd);
@ -557,25 +554,21 @@ extern u_char getrandom8();
extern u_int16_t getrandom16();
extern u_int32_t getrandom32();
#define EVENT_DRUGS BASE_VERSION
extern void rejoin_doquits(aClient *sptr);
extern void rejoin_dojoinandmode(aClient *sptr);
extern void rejoin_leave(aClient *sptr);
extern void rejoin_joinandmode(aClient *sptr);
extern void ident_failed(aClient *cptr);
extern MODVAR char extchmstr[4][64];
extern MODVAR char extbanstr[EXTBANTABLESZ+1];
extern int extcmode_default_requirechop(aClient *, aChannel *, char *, int, int);
extern int extcmode_default_requirehalfop(aClient *, aChannel *, char *, int, int);
extern int extcmode_default_requirechop(aClient *, aChannel *, char, char *, int, int);
extern int extcmode_default_requirehalfop(aClient *, aChannel *, char, char *, int, int);
extern Cmode_t extcmode_get(Cmode *);
extern void extcmode_init(void);
extern CmodeParam *extcmode_get_struct(CmodeParam *, char);
extern void make_extcmodestr();
extern CmodeParam *extcmode_duplicate_paramlist(CmodeParam *);
extern void extcmode_free_paramlist(CmodeParam *);
extern void extcmode_duplicate_paramlist(void **xi, void **xo);
extern void extcmode_free_paramlist(void **ar);
extern int do_chanflood(ChanFloodProt *, int);
extern void do_chanflood_action(aChannel *, int, char *);
extern char *channel_modef_string(ChanFloodProt *);
extern void chmode_str(struct ChMode, char *, char *, size_t, size_t);
extern char *get_cptr_status(aClient *);
extern char *get_snostr(long);
@ -584,11 +577,6 @@ extern void InitDebug(void);
extern int InitwIRCD(int argc, char **);
extern void SocketLoop(void *);
#endif
#ifdef STATIC_LINKING
extern int l_commands_Init(ModuleInfo *);
extern int l_commands_Test(ModuleInfo *);
extern int l_commands_Load(int);
#endif
extern void sendto_chmodemucrap(aClient *, aChannel *, char *);
extern void verify_opercount(aClient *, char *);
extern int valid_host(char *host);
@ -667,7 +655,7 @@ extern MODVAR int dontspread;
/* Efuncs */
extern MODVAR int (*do_join)(aClient *, aClient *, int, char **);
extern MODVAR void (*join_channel)(aChannel *chptr, aClient *cptr, aClient *sptr, int flags);
extern MODVAR int (*can_join)(aClient *cptr, aClient *sptr, aChannel *chptr, char *key, char *link, char *parv[]);
extern MODVAR int (*can_join)(aClient *cptr, aClient *sptr, aChannel *chptr, char *key, char *parv[]);
extern MODVAR void (*do_mode)(aChannel *chptr, aClient *cptr, aClient *sptr, int parc, char *parv[], time_t sendts, int samode);
extern MODVAR void (*set_mode)(aChannel *chptr, aClient *cptr, int parc, char *parv[], u_int *pcount,
char pvar[MAXMODEPARAMS][MODEBUFLEN + 3], int bounce);
@ -694,9 +682,6 @@ extern MODVAR int (*place_host_ban)(aClient *sptr, int action, char *reason, lon
extern MODVAR int (*dospamfilter)(aClient *sptr, char *str_in, int type, char *target, int flags, aTKline **rettk);
extern MODVAR int (*dospamfilter_viruschan)(aClient *sptr, aTKline *tk, int type);
extern MODVAR void (*send_list)(aClient *cptr, int numsend);
extern MODVAR char *(*stripbadwords_channel)(char *str, int *blocked);
extern MODVAR char *(*stripbadwords_message)(char *str, int *blocked);
extern MODVAR char *(*stripbadwords_quit)(char *str, int *blocked);
extern MODVAR unsigned char *(*StripColors)(unsigned char *text);
extern MODVAR const char *(*StripControlCodes)(unsigned char *text);
extern MODVAR void (*spamfilter_build_user_string)(char *buf, char *nick, aClient *acptr);
@ -710,19 +695,10 @@ extern MODVAR int max_connection_count;
extern int add_listmode(Ban **list, aClient *cptr, aChannel *chptr, char *banid);
extern int del_listmode(Ban **list, aChannel *chptr, char *banid);
extern int Halfop_mode(long mode);
extern void chanfloodtimer_add(aChannel *chptr, char mflag, long mbit, time_t when);
extern void chanfloodtimer_del(aChannel *chptr, char mflag, long mbit);
extern char *clean_ban_mask(char *, int, aClient *);
extern void chanfloodtimer_stopchantimers(aChannel *chptr);
extern int find_invex(aChannel *chptr, aClient *sptr);
extern void DoMD5(unsigned char *mdout, const unsigned char *src, unsigned long n);
extern char *md5hash(unsigned char *dst, const unsigned char *src, unsigned long n);
#ifdef JOINTHROTTLE
aJFlood *cmodej_addentry(aClient *cptr, aChannel *chptr);
void cmodej_delentry(aJFlood *e);
void cmodej_deluserentries(aClient *cptr);
void cmodej_delchannelentries(aChannel *chptr);
#endif
extern void charsys_reset(void);
extern void charsys_addmultibyterange(char s1, char e1, char s2, char e2);
extern void charsys_addallowed(char *s);
@ -747,6 +723,13 @@ extern char *unreal_time_synch_error(void);
extern int unreal_time_synch(int timeout);
extern int extban_is_banned_helper(char *buf);
extern char *getcloak(aClient *sptr);
extern unsigned char param_to_slot_mapping[256];
extern char *cm_getparameter(aChannel *chptr, char mode);
extern void cm_putparameter(aChannel *chptr, char mode, char *str);
extern void cm_freeparameter(aChannel *chptr, char mode);
extern char *cm_getparameter_ex(void **p, char mode);
extern void cm_putparameter_ex(void **p, char mode, char *str);
extern void cm_freeparameter_ex(void **p, char mode, char *str);
extern void kick_insecure_users(aChannel *);
extern int file_exists(char* file);
extern void free_motd(aMotdFile *motd); /* s_serv.c */
@ -762,3 +745,4 @@ extern MODVAR char serveropts[];
extern MODVAR char *IsupportStrings[];
extern void finish_auth(aClient *acptr);
extern void read_packet(int fd, int revents, void *data);
extern void sendto_realops_and_log(char *fmt, ...);

75
include/list.h

@ -9,6 +9,22 @@
#include "common.h"
#ifndef _WIN32
#define SINLINE static inline
#else
#define SINLINE static
#endif
#ifdef _WIN32
#define typeof(x) aClient
/* ^ FIXME if/when Microsoft supports this.
* All functions use aClient at the moment, with the exception of CAP, which has
* to use list_for_each_entry2 because of it
* Yeah this looks ugly and hacky.. thanks nenolod for making all code use this
* non-portable gcc-specific stuff and violating all our code rules. Once again.
*/
#endif
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
@ -38,7 +54,7 @@ struct list_head {
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
static inline void INIT_LIST_HEAD(struct list_head *list)
SINLINE void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
@ -50,7 +66,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static inline void __list_add(struct list_head *new,
SINLINE void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
@ -68,7 +84,7 @@ static inline void __list_add(struct list_head *new,
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
static inline void list_add(struct list_head *new, struct list_head *head)
SINLINE void list_add(struct list_head *new, struct list_head *head)
{
__list_add(new, head, head->next);
}
@ -82,7 +98,7 @@ static inline void list_add(struct list_head *new, struct list_head *head)
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
static inline void list_add_tail(struct list_head *new, struct list_head *head)
SINLINE void list_add_tail(struct list_head *new, struct list_head *head)
{
__list_add(new, head->prev, head);
}
@ -94,7 +110,7 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static inline void __list_del(struct list_head * prev, struct list_head * next)
SINLINE void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
prev->next = next;
@ -106,12 +122,12 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
* Note: list_empty() on entry does not return true after this, the entry is
* in an undefined state.
*/
static inline void __list_del_entry(struct list_head *entry)
SINLINE void __list_del_entry(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
}
static inline void list_del(struct list_head *entry)
SINLINE void list_del(struct list_head *entry)
{
__list_del_entry(entry);
INIT_LIST_HEAD(entry);
@ -124,7 +140,7 @@ static inline void list_del(struct list_head *entry)
*
* If @old was empty, it will be overwritten.
*/
static inline void list_replace(struct list_head *old,
SINLINE void list_replace(struct list_head *old,
struct list_head *new)
{
new->next = old->next;
@ -133,7 +149,7 @@ static inline void list_replace(struct list_head *old,
new->prev->next = new;
}
static inline void list_replace_init(struct list_head *old,
SINLINE void list_replace_init(struct list_head *old,
struct list_head *new)
{
list_replace(old, new);
@ -144,7 +160,7 @@ static inline void list_replace_init(struct list_head *old,
* list_del_init - deletes entry from list and reinitialize it.
* @entry: the element to delete from the list.
*/
static inline void list_del_init(struct list_head *entry)
SINLINE void list_del_init(struct list_head *entry)
{
__list_del_entry(entry);
INIT_LIST_HEAD(entry);
@ -155,7 +171,7 @@ static inline void list_del_init(struct list_head *entry)
* @list: the entry to move
* @head: the head that will precede our entry
*/
static inline void list_move(struct list_head *list, struct list_head *head)
SINLINE void list_move(struct list_head *list, struct list_head *head)
{
__list_del_entry(list);
list_add(list, head);
@ -166,7 +182,7 @@ static inline void list_move(struct list_head *list, struct list_head *head)
* @list: the entry to move
* @head: the head that will follow our entry
*/
static inline void list_move_tail(struct list_head *list,
SINLINE void list_move_tail(struct list_head *list,
struct list_head *head)
{
__list_del_entry(list);
@ -178,7 +194,7 @@ static inline void list_move_tail(struct list_head *list,
* @list: the entry to test
* @head: the head of the list
*/
static inline int list_is_last(const struct list_head *list,
SINLINE int list_is_last(const struct list_head *list,
const struct list_head *head)
{
return list->next == head;
@ -188,7 +204,7 @@ static inline int list_is_last(const struct list_head *list,
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
static inline int list_empty(const struct list_head *head)
SINLINE int list_empty(const struct list_head *head)
{
return head->next == head;
}
@ -206,7 +222,7 @@ static inline int list_empty(const struct list_head *head)
* to the list entry is list_del_init(). Eg. it cannot be used
* if another CPU could re-list_add() it.
*/
static inline int list_empty_careful(const struct list_head *head)
SINLINE int list_empty_careful(const struct list_head *head)
{
struct list_head *next = head->next;
return (next == head) && (next == head->prev);
@ -216,7 +232,7 @@ static inline int list_empty_careful(const struct list_head *head)
* list_rotate_left - rotate the list to the left
* @head: the head of the list
*/
static inline void list_rotate_left(struct list_head *head)
SINLINE void list_rotate_left(struct list_head *head)
{
struct list_head *first;
@ -230,12 +246,12 @@ static inline void list_rotate_left(struct list_head *head)
* list_is_singular - tests whether a list has just one entry.
* @head: the list to test.
*/
static inline int list_is_singular(const struct list_head *head)
SINLINE int list_is_singular(const struct list_head *head)
{
return !list_empty(head) && (head->next == head->prev);
}
static inline void __list_cut_position(struct list_head *list,
SINLINE void __list_cut_position(struct list_head *list,
struct list_head *head, struct list_head *entry)
{
struct list_head *new_first = entry->next;
@ -261,7 +277,7 @@ static inline void __list_cut_position(struct list_head *list,
* losing its data.
*
*/
static inline void list_cut_position(struct list_head *list,
SINLINE void list_cut_position(struct list_head *list,
struct list_head *head, struct list_head *entry)
{
if (list_empty(head))
@ -275,7 +291,7 @@ static inline void list_cut_position(struct list_head *list,
__list_cut_position(list, head, entry);
}
static inline void __list_splice(const struct list_head *list,
SINLINE void __list_splice(const struct list_head *list,
struct list_head *prev,
struct list_head *next)
{
@ -294,7 +310,7 @@ static inline void __list_splice(const struct list_head *list,
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
static inline void list_splice(const struct list_head *list,
SINLINE void list_splice(const struct list_head *list,
struct list_head *head)
{
if (!list_empty(list))
@ -306,7 +322,7 @@ static inline void list_splice(const struct list_head *list,
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
static inline void list_splice_tail(struct list_head *list,
SINLINE void list_splice_tail(struct list_head *list,
struct list_head *head)
{
if (!list_empty(list))
@ -320,7 +336,7 @@ static inline void list_splice_tail(struct list_head *list,
*
* The list at @list is reinitialised
*/
static inline void list_splice_init(struct list_head *list,
SINLINE void list_splice_init(struct list_head *list,
struct list_head *head)
{
if (!list_empty(list)) {
@ -337,7 +353,7 @@ static inline void list_splice_init(struct list_head *list,
* Each of the lists is a queue.
* The list at @list is reinitialised
*/
static inline void list_splice_tail_init(struct list_head *list,
SINLINE void list_splice_tail_init(struct list_head *list,
struct list_head *head)
{
if (!list_empty(list)) {
@ -425,6 +441,17 @@ static inline void list_splice_tail_init(struct list_head *list,
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
/**
* list_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry2(pos, tpe, head, member) \