From d57c147626ba1a0646bf49bf16c0653c3e501282 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Tue, 11 Feb 2003 20:45:35 +0000 Subject: [PATCH] * (all): Version 0.1-alpha released SVN Revision: 71 --- ChangeLog | 4 ++ doc/guide.html | 93 ++++++++++++++++++++++++++++---------------- doc/guide.tex | 38 ++++++++++++++++-- src/ejabberd.app | 2 +- src/ejabberd.hrl | 2 +- src/ejabberd_c2s.erl | 1 - 6 files changed, 100 insertions(+), 40 deletions(-) create mode 100644 ChangeLog diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..3c729f20a --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4 @@ +2003-02-11 Alexey Shchepin + + * (all): Version 0.1-alpha released + diff --git a/doc/guide.html b/doc/guide.html index ed721228e..061a91e43 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -302,9 +302,28 @@ Following access rules pre-defined: all
Always return ``allow''
none
Always return ``deny'' + + +

3.1.3  Shapers Configuration

+ + +With shapers is possible to bound connection traffic. The declarations of +shapers in config file have following syntax: +
+{shaper, <shapername>, <kind>}.
+
Currently implemented only one kind of shaper: maxrate. It have +following syntax: +
+{maxrate, <rate>}
+
where <rate> means maximum allowed incomig rate in bytes/second. +E. g. to define shaper with name ``normal'' and maximum allowed rate +1000 bytes/s, add following line in config: +
+{shaper, normal, {maxrate, 1000}}.
+
-

3.1.3  Listened Sockets

+

3.1.4  Listened Sockets

Option listen defines list of listened sockets and what services @@ -323,6 +342,9 @@ Following options defined:
{access, <access rule>}
This option defines access of users to this C2S port. Default value is ``all''. +
{shaper, <access rule>}
This option is like previous, but + use shapers instead of ``allow'' and ``deny''. Default + value is ``none''.
ejabberd_s2s_in
This module serves incoming S2S connections.
ejabberd_service
This module serves connections to Jabber @@ -331,12 +353,17 @@ Following options defined: For example, the following configuration defines that C2S connections are listened on port 5222 and denied for user ``bad'', S2S on port 5269 and that service conference.jabber.org must be connected to port 8888 -with a password ``secret''. +with a password ``secret''. Also all users except admins have traffic +limit 1000 b/s.
 {acl, blocked, {user, "bad"}}.
 {access, c2s, [{deny, blocked},
                {allow, all}]}.
-{listen, [{5222, ejabberd_c2s,     start, [{access, c2s}]},
+{shaper, normal, {maxrate, 1000}}.
+{access, c2s_shaper, [{none, admin},
+                      {normal, all}]}.
+{listen, [{5222, ejabberd_c2s,     start, [{access, c2s},
+                                           {shaper, c2s_shaper}]},
           {5269, ejabberd_s2s_in,  start, []},
           {8888, ejabberd_service, start,
            [{host, "conference.jabber.org", [{password, "secret"}]}]}
@@ -344,7 +371,7 @@ with a password ``secret''.
 
-

3.1.4  Modules

+

3.1.5  Modules

Option modules defines the list of modules that will be loaded after @@ -370,7 +397,7 @@ Example: -

3.2  Online Configuration and Monitoring

+

3.2  Online Configuration and Monitoring

To perform online reconfiguration of ejabberd you will need to have @@ -401,7 +428,7 @@ Identity of server.

-

3.2.1  Node config: Global Configuration

+

3.2.1  Node config: Global Configuration

Under this node the following nodes exists:

@@ -455,11 +482,11 @@ removed user is online, then he will be disconnected. Also user-related data
-

3.2.2  Node online users: List of Online Users

+

3.2.2  Node online users: List of Online Users

-

3.2.3  Node all users: List of Registered User

+

3.2.3  Node all users: List of Registered User


@@ -473,11 +500,11 @@ removed user is online, then he will be disconnected. Also user-related data

-

3.2.4  Node outgoing s2s: List of Outgoing S2S connections

+

3.2.4  Node outgoing s2s: List of Outgoing S2S connections

-

3.2.5  Node running nodes: List of Running ejabberd Nodes

+

3.2.5  Node running nodes: List of Running ejabberd Nodes


@@ -491,18 +518,18 @@ removed user is online, then he will be disconnected. Also user-related data

-

3.2.6  Node stopped nodes: List of Stopped Nodes

+

3.2.6  Node stopped nodes: List of Stopped Nodes

TBD

-

4  Distribution

+

4  Distribution

-

4.1  How it works

+

4.1  How it works

A Jabber domain is served by one or more ejabberd nodes. These nodes can @@ -522,7 +549,7 @@ router; -

4.1.1  Router

+

4.1.1  Router

This module is the main router of Jabber packets on each node. It routes them based on their destinations domains. It has two tables: local and global @@ -534,7 +561,7 @@ manager.

-

4.1.2  Local Router

+

4.1.2  Local Router

This module routes packets which have a destination domain equal to this server name. If destination JID has a node, then it routed to the session manager, @@ -542,7 +569,7 @@ else it is processed depending on it's content.

-

4.1.3  Session Manager

+

4.1.3  Session Manager

This module routes packets to local users. It searches for what user resource packet must be sended via presence table. If this resource is connected to @@ -551,7 +578,7 @@ the packet is sent to session manager on that node.

-

4.1.4  S2S Manager

+

4.1.4  S2S Manager

This module routes packets to other Jabber servers. First, it checks if an open S2S connection from the domain of the packet source to the domain of @@ -562,19 +589,19 @@ does not exist, then it is opened and registered.

-

A  Built-in Modules

+

A  Built-in Modules

-

A.1  Common Options

+

A.1  Common Options

Following options used by many modules, so they described in separate section.

-

A.1.1  Option iqdisc

+

A.1.1  Option iqdisc

Many modules define handlers for processing IQ queries of different namespaces to this server or to user (e. g. to myjabber.org or to @@ -604,7 +631,7 @@ Example: -

A.1.2  Option host

+

A.1.2  Option host

Some modules may act as services, and wants to have different domain name. This option explicitly defines this name.
@@ -619,27 +646,27 @@ Example: -

A.2  mod_register

+

A.2  mod_register

-

A.3  mod_roster

+

A.3  mod_roster

-

A.4  mod_configure

+

A.4  mod_configure

-

A.5  mod_disco

+

A.5  mod_disco

-

A.6  mod_stats

+

A.6  mod_stats

This module adds support of @@ -654,22 +681,22 @@ TBD about access.

-

A.7  mod_vcard

+

A.7  mod_vcard

-

A.8  mod_offline

+

A.8  mod_offline

-

A.9  mod_echo

+

A.9  mod_echo

-

A.10  mod_private

+

A.10  mod_private

This module adds support of @@ -682,7 +709,7 @@ Options: -

A.11  mod_time

+

A.11  mod_time

This module answers UTC time on jabber:iq:time queries.
@@ -693,7 +720,7 @@ Options: -

A.12  mod_version

+

A.12  mod_version

This module answers ejabberd version on jabber:iq:version queries.
@@ -704,7 +731,7 @@ Options: -

B  I18n/L10n

+

B  I18n/L10n

Many modules supports xml:lang attribute inside IQ queries. E. g. diff --git a/doc/guide.tex b/doc/guide.tex index bba1349d1..2d53280d9 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -291,6 +291,30 @@ Following access rules pre-defined: \end{description} + +\subsubsection{Shapers Configuration} +\label{sec:configshaper} + +With shapers is possible to bound connection traffic. The declarations of +shapers in config file have following syntax: +\begin{verbatim} +{shaper, , }. +\end{verbatim} +Currently implemented only one kind of shaper: \texttt{maxrate}. It have +following syntax: +\begin{verbatim} +{maxrate, } +\end{verbatim} +where \texttt{} means maximum allowed incomig rate in bytes/second. +E.\,g.\ to define shaper with name ``\texttt{normal}'' and maximum allowed rate +1000\,bytes/s, add following line in config: +\begin{verbatim} +{shaper, normal, {maxrate, 1000}}. +\end{verbatim} + + + + \subsubsection{Listened Sockets} \label{sec:configlistened} @@ -311,6 +335,9 @@ Currently three modules are implemented: \begin{description} \item[\texttt{\{access, \}}] This option defines access of users to this C2S port. Default value is ``\texttt{all}''. + \item[\texttt{\{shaper, \}}] This option is like previous, but + use shapers instead of ``\texttt{allow}'' and ``\texttt{deny}''. Default + value is ``\texttt{none}''. \end{description} \item[\texttt{ejabberd\_s2s\_in}] This module serves incoming S2S connections. \item[\texttt{ejabberd\_service}] This module serves connections to \Jabber{} @@ -320,13 +347,17 @@ Currently three modules are implemented: For example, the following configuration defines that C2S connections are listened on port 5222 and denied for user ``\texttt{bad}'', S2S on port 5269 and that service \texttt{conference.jabber.org} must be connected to port 8888 -with a password ``\texttt{secret}''. - +with a password ``\texttt{secret}''. Also all users except admins have traffic +limit 1000\,b/s. \begin{verbatim} {acl, blocked, {user, "bad"}}. {access, c2s, [{deny, blocked}, {allow, all}]}. -{listen, [{5222, ejabberd_c2s, start, [{access, c2s}]}, +{shaper, normal, {maxrate, 1000}}. +{access, c2s_shaper, [{none, admin}, + {normal, all}]}. +{listen, [{5222, ejabberd_c2s, start, [{access, c2s}, + {shaper, c2s_shaper}]}, {5269, ejabberd_s2s_in, start, []}, {8888, ejabberd_service, start, [{host, "conference.jabber.org", [{password, "secret"}]}]} @@ -336,7 +367,6 @@ with a password ``\texttt{secret}''. - \subsubsection{Modules} \label{sec:configmodules} diff --git a/src/ejabberd.app b/src/ejabberd.app index bc992887d..231af035d 100644 --- a/src/ejabberd.app +++ b/src/ejabberd.app @@ -2,7 +2,7 @@ {application, ejabberd, [{description, "ejabberd"}, - {vsn, "0.0.1-alpha"}, + {vsn, "0.1-alpha"}, {modules, [acl, ejabberd, ejabberd_auth, diff --git a/src/ejabberd.hrl b/src/ejabberd.hrl index 6cac0e995..78cf0e7b4 100644 --- a/src/ejabberd.hrl +++ b/src/ejabberd.hrl @@ -6,7 +6,7 @@ %%% Id : $Id$ %%%---------------------------------------------------------------------- --define(VERSION, "0.0.1-alpha"). +-define(VERSION, "0.1-alpha"). %-define(ejabberd_debug, true). %-define(DBGFSM, true). diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index a6b4e691a..777bcc28b 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -380,7 +380,6 @@ receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid) -> {ok, Text} -> ShaperSt1 = receive {change_shaper, Shaper} -> - io:format("RECV: ChShaper to ~p~n", [Shaper]), shaper:new(Shaper) after 0 -> ShaperState