mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
* doc/Makefile: echo seems to interpret \n and \v under MacOSX
Leopard. I fixed the problem but let me know if it breaks build chain in other contexts. SVN Revision: 1011
This commit is contained in:
parent
4f9e510cd5
commit
b84f85ba8a
@ -1,6 +1,10 @@
|
|||||||
2007-12-01 Mickael Remond <mremond@process-one.net>
|
2007-12-01 Mickael Remond <mremond@process-one.net>
|
||||||
|
|
||||||
* doc/guide.tex: Updated Windows compilation instructions.
|
* doc/Makefile: echo seems to interpret \n and \v under MacOSX
|
||||||
|
Leopard. I fixed the problem but let me know if it breaks build
|
||||||
|
chain in other contexts.
|
||||||
|
|
||||||
|
* Doc/guide.tex: Updated Windows compilation instructions.
|
||||||
* src/configure.erl: Likewise.
|
* src/configure.erl: Likewise.
|
||||||
|
|
||||||
* doc/ejabberd.hrl: Preparing ejabberd 2.0.0 beta release.
|
* doc/ejabberd.hrl: Preparing ejabberd 2.0.0 beta release.
|
||||||
|
@ -9,8 +9,7 @@ release:
|
|||||||
@echo "* Do not forget to update the features in introduction.tex (including \new{} and \improved{} tags)."
|
@echo "* Do not forget to update the features in introduction.tex (including \new{} and \improved{} tags)."
|
||||||
@read -p "press any key to continue"
|
@read -p "press any key to continue"
|
||||||
@echo "% ejabberd version (automatically generated)." > version.tex
|
@echo "% ejabberd version (automatically generated)." > version.tex
|
||||||
@echo "\newcommand{\version}{"`cat ../src/ejabberd.hrl | grep VERSION |\
|
@echo "\\\newcommand{\\\version}{"`cat ../src/ejabberd.hrl | grep VERSION | sed s/-define\(VERSION,\ \"//g | sed s/\"\).//g`"}" >> version.tex
|
||||||
sed s/-define\(VERSION,\ \"//g | sed s/\"\).//g`"}" >> version.tex
|
|
||||||
|
|
||||||
html: guide.html dev.html features.html
|
html: guide.html dev.html features.html
|
||||||
|
|
||||||
@ -31,7 +30,7 @@ clean:
|
|||||||
|
|
||||||
guide.html: guide.tex
|
guide.html: guide.tex
|
||||||
hevea -fix -noiso -pedantic guide.tex
|
hevea -fix -noiso -pedantic guide.tex
|
||||||
|
|
||||||
dev.html: dev.tex
|
dev.html: dev.tex
|
||||||
hevea -fix -noiso -pedantic dev.tex
|
hevea -fix -noiso -pedantic dev.tex
|
||||||
|
|
||||||
|
535
doc/dev.html
535
doc/dev.html
@ -1,23 +1,15 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||||
<HTML>
|
<HTML>
|
||||||
<HEAD>
|
|
||||||
<TITLE>Ejabberd 2.0.0 beta Developers Guide
|
|
||||||
</TITLE>
|
|
||||||
|
|
||||||
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
<HEAD>
|
||||||
<META name="GENERATOR" content="hevea 1.09">
|
|
||||||
|
<TITLE>Ejabberd 2.0.0b1 Developers Guide</TITLE>
|
||||||
|
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||||
|
<META name="GENERATOR" content="hevea 1.08">
|
||||||
<STYLE type="text/css">
|
<STYLE type="text/css">
|
||||||
.li-itemize{margin:1ex 0ex;}
|
|
||||||
.li-enumerate{margin:1ex 0ex;}
|
|
||||||
.dd-description{margin:0ex 0ex 1ex 4ex;}
|
|
||||||
.dt-description{margin:0ex;}
|
|
||||||
.toc{list-style:none;}
|
.toc{list-style:none;}
|
||||||
.thefootnotes{text-align:left;margin:0ex;}
|
|
||||||
.dt-thefootnotes{margin:0em;}
|
|
||||||
.dd-thefootnotes{margin:0em 0em 0em 2em;}
|
|
||||||
.footnoterule{margin:1em auto 1em 0px;width:50%;}
|
|
||||||
.caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
|
|
||||||
.title{margin:auto;text-align:center}
|
.title{margin:auto;text-align:center}
|
||||||
.center{text-align:center;margin-left:auto;margin-right:auto;}
|
.center{text-align:center;margin-left:auto;margin-right:auto;}
|
||||||
.flushleft{text-align:left;margin-left:0ex;margin-right:auto;}
|
.flushleft{text-align:left;margin-left:0ex;margin-right:auto;}
|
||||||
@ -25,157 +17,302 @@
|
|||||||
DIV TABLE{margin-left:inherit;margin-right:inherit;}
|
DIV TABLE{margin-left:inherit;margin-right:inherit;}
|
||||||
PRE{text-align:left;margin-left:0ex;margin-right:auto;}
|
PRE{text-align:left;margin-left:0ex;margin-right:auto;}
|
||||||
BLOCKQUOTE{margin-left:4ex;margin-right:4ex;text-align:left;}
|
BLOCKQUOTE{margin-left:4ex;margin-right:4ex;text-align:left;}
|
||||||
TD P{margin:0px;}
|
|
||||||
.boxed{border:1px solid black}
|
|
||||||
.textboxed{border:1px solid black}
|
|
||||||
.vbar{border:none;width:2px;background-color:black;}
|
|
||||||
.hbar{border:none;height:2px;width:100%;background-color:black;}
|
|
||||||
.hfill{border:none;height:1px;width:200%;background-color:black;}
|
|
||||||
.vdisplay{border-collapse:separate;border-spacing:2px;width:auto; empty-cells:show; border:2px solid red;}
|
|
||||||
.vdcell{white-space:nowrap;padding:0px;width:auto; border:2px solid green;}
|
|
||||||
.display{border-collapse:separate;border-spacing:2px;width:auto; border:none;}
|
|
||||||
.dcell{white-space:nowrap;padding:0px;width:auto; border:none;}
|
|
||||||
.dcenter{margin:0ex auto;}
|
|
||||||
.vdcenter{border:solid #FF8000 2px; margin:0ex auto;}
|
|
||||||
.minipage{text-align:left; margin-left:0em; margin-right:auto;}
|
|
||||||
.marginpar{border:solid thin black; width:20%; text-align:left;}
|
|
||||||
.marginparleft{float:left; margin-left:0ex; margin-right:1ex;}
|
|
||||||
.marginparright{float:right; margin-left:1ex; margin-right:0ex;}
|
|
||||||
.theorem{text-align:left;margin:1ex auto 1ex 0ex;}
|
|
||||||
.part{margin:auto;text-align:center}
|
.part{margin:auto;text-align:center}
|
||||||
</STYLE>
|
</STYLE>
|
||||||
</HEAD>
|
</HEAD>
|
||||||
|
|
||||||
<BODY >
|
<BODY >
|
||||||
<!--HEVEA command line is: /usr/local/bin/hevea -fix -noiso -pedantic dev.tex -->
|
<!--HEVEA command line is: hevea -fix -noiso -pedantic dev.tex -->
|
||||||
<!--CUT DEF section 1 --><P><A NAME="titlepage"></A>
|
<!--HTMLHEAD-->
|
||||||
|
<!--ENDHTML-->
|
||||||
|
<!--PREFIX <ARG ></ARG>-->
|
||||||
|
<!--CUT DEF section 1 -->
|
||||||
|
|
||||||
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.0 beta Developers Guide</H1><H3 CLASS="titlerest">Alexey Shchepin<BR>
|
<BR>
|
||||||
<A HREF="mailto:alexey@sevcom.net"><TT>mailto:alexey@sevcom.net</TT></A><BR>
|
<BR>
|
||||||
<A HREF="xmpp:aleksey@jabber.ru"><TT>xmpp:aleksey@jabber.ru</TT></A></H3></TD></TR>
|
<A NAME="titlepage"></A>
|
||||||
</TABLE><DIV CLASS="center">
|
|
||||||
|
|
||||||
<IMG SRC="logo.png" ALT="logo.png">
|
<TABLE CLASS="title">
|
||||||
|
<TR><TD>
|
||||||
|
<H1 CLASS="titlemain">Ejabberd 2.0.0b1 Developers Guide</H1>
|
||||||
|
<H3 CLASS="titlerest">Alexey Shchepin<BR>
|
||||||
|
<A HREF="mailto:alexey@sevcom.net"><TT>mailto:alexey@sevcom.net</TT></A><BR>
|
||||||
|
<A HREF="xmpp:aleksey@jabber.ru"><TT>xmpp:aleksey@jabber.ru</TT></A></H3></TD>
|
||||||
|
</TR></TABLE><BR>
|
||||||
|
<BR>
|
||||||
|
<DIV CLASS="center">
|
||||||
|
|
||||||
|
<IMG SRC="logo.png" ALT="logo.png">
|
||||||
|
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
<BR>
|
||||||
|
|
||||||
|
</DIV>
|
||||||
|
<BLOCKQUOTE CLASS="quotation"><I>I can thoroughly recommend ejabberd for ease of setup –
|
||||||
|
Kevin Smith, Current maintainer of the Psi project</I></BLOCKQUOTE>
|
||||||
|
<!--TOC section Contents-->
|
||||||
|
|
||||||
|
<H2 CLASS="section">Contents</H2><!--SEC END -->
|
||||||
|
|
||||||
</DIV><BLOCKQUOTE CLASS="quotation"><I>I can thoroughly recommend ejabberd for ease of setup –
|
|
||||||
Kevin Smith, Current maintainer of the Psi project</I></BLOCKQUOTE><!--TOC section Contents-->
|
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR -->Contents</H2><!--SEC END --><UL CLASS="toc"><LI CLASS="li-toc">
|
|
||||||
<A HREF="#htoc1">1  Key Features</A>
|
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc2">2  Additional Features</A>
|
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc3">3  How it Works</A>
|
|
||||||
<UL CLASS="toc"><LI CLASS="li-toc">
|
<UL CLASS="toc"><LI CLASS="li-toc">
|
||||||
<A HREF="#htoc4">3.1  Router</A>
|
<A HREF="#htoc1">1 Key Features</A>
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc5">3.2  Local Router</A>
|
<LI CLASS="li-toc"><A HREF="#htoc2">2 Additional Features</A>
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc6">3.3  Session Manager</A>
|
<LI CLASS="li-toc"><A HREF="#htoc3">3 How it Works</A>
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc7">3.4  S2S Manager</A>
|
|
||||||
</LI></UL>
|
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc8">4  XML Representation</A>
|
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc9">5  Module <TT>xml</TT></A>
|
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc10">6  Module <TT>xml_stream</TT></A>
|
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc11">7  Modules</A>
|
|
||||||
<UL CLASS="toc"><LI CLASS="li-toc">
|
<UL CLASS="toc"><LI CLASS="li-toc">
|
||||||
<A HREF="#htoc12">7.1  Module gen_iq_handler</A>
|
<A HREF="#htoc4">3.1 Router</A>
|
||||||
</LI><LI CLASS="li-toc"><A HREF="#htoc13">7.2  Services</A>
|
<LI CLASS="li-toc"><A HREF="#htoc5">3.2 Local Router</A>
|
||||||
</LI></UL>
|
<LI CLASS="li-toc"><A HREF="#htoc6">3.3 Session Manager</A>
|
||||||
</LI></UL><P>Introduction
|
<LI CLASS="li-toc"><A HREF="#htoc7">3.4 S2S Manager</A>
|
||||||
<A NAME="intro"></A></P><P><TT>ejabberd</TT> is a free and open source instant messaging server written in <A HREF="http://www.erlang.org/">Erlang</A>.</P><P><TT>ejabberd</TT> is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.</P><P><TT>ejabberd</TT> is designed to be a rock-solid and feature rich XMPP server.</P><P><TT>ejabberd</TT> is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.</P><!--TOC section Key Features-->
|
</UL>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc1">1</A>  Key Features</H2><!--SEC END --><P>
|
<LI CLASS="li-toc"><A HREF="#htoc8">4 Authentication</A>
|
||||||
|
<UL CLASS="toc">
|
||||||
|
<UL CLASS="toc"><LI CLASS="li-toc">
|
||||||
|
<A HREF="#htoc9">4.0.1 External</A>
|
||||||
|
</UL>
|
||||||
|
</UL>
|
||||||
|
<LI CLASS="li-toc"><A HREF="#htoc10">5 XML Representation</A>
|
||||||
|
<LI CLASS="li-toc"><A HREF="#htoc11">6 Module <TT>xml</TT></A>
|
||||||
|
<LI CLASS="li-toc"><A HREF="#htoc12">7 Module <TT>xml_stream</TT></A>
|
||||||
|
<LI CLASS="li-toc"><A HREF="#htoc13">8 Modules</A>
|
||||||
|
<UL CLASS="toc"><LI CLASS="li-toc">
|
||||||
|
<A HREF="#htoc14">8.1 Module gen_iq_handler</A>
|
||||||
|
<LI CLASS="li-toc"><A HREF="#htoc15">8.2 Services</A>
|
||||||
|
</UL>
|
||||||
|
</UL>
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
<A NAME="intro"></A><BR>
|
||||||
|
<BR>
|
||||||
|
<BR>
|
||||||
|
<BR>
|
||||||
|
<TT>ejabberd</TT> is a free and open source instant messaging server written in <A HREF="http://www.erlang.org/">Erlang</A>.<BR>
|
||||||
|
<BR>
|
||||||
|
<TT>ejabberd</TT> is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.<BR>
|
||||||
|
<BR>
|
||||||
|
<TT>ejabberd</TT> is designed to be a rock-solid and feature rich XMPP server.<BR>
|
||||||
|
<BR>
|
||||||
|
<TT>ejabberd</TT> is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.<BR>
|
||||||
|
<BR>
|
||||||
|
<!--TOC section Key Features-->
|
||||||
|
|
||||||
|
<H2 CLASS="section"><A NAME="htoc1">1</A> Key Features</H2><!--SEC END -->
|
||||||
|
|
||||||
<A NAME="keyfeatures"></A>
|
<A NAME="keyfeatures"></A>
|
||||||
</P><P><TT>ejabberd</TT> is:
|
|
||||||
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
|
<TT>ejabberd</TT> is:
|
||||||
Cross-platform: <TT>ejabberd</TT> runs under Microsoft Windows and Unix derived systems such as Linux, FreeBSD and NetBSD.</LI><LI CLASS="li-itemize">Distributed: You can run <TT>ejabberd</TT> on a cluster of machines and all of them will serve the same Jabber domain(s). When you need more capacity you can simply add a new cheap node to your cluster. Accordingly, you do not need to buy an expensive high-end machine to support tens of thousands concurrent users.</LI><LI CLASS="li-itemize">Fault-tolerant: You can deploy an <TT>ejabberd</TT> cluster so that all the information required for a properly working service will be replicated permanently on all nodes. This means that if one of the nodes crashes, the others will continue working without disruption. In addition, nodes also can be added or replaced `on the fly'.</LI><LI CLASS="li-itemize">Administrator Friendly: <TT>ejabberd</TT> is built on top of the Open Source Erlang. As a result you do not need to install an external database, an external web server, amongst others because everything is already included, and ready to run out of the box. Other administrator benefits include:
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
|
Cross-platform: <TT>ejabberd</TT> runs under Microsoft Windows and Unix derived systems such as Linux, FreeBSD and NetBSD.<BR>
|
||||||
|
<BR>
|
||||||
|
<LI CLASS="li-itemize">Distributed: You can run <TT>ejabberd</TT> on a cluster of machines and all of them will serve the same Jabber domain(s). When you need more capacity you can simply add a new cheap node to your cluster. Accordingly, you do not need to buy an expensive high-end machine to support tens of thousands concurrent users.<BR>
|
||||||
|
<BR>
|
||||||
|
<LI CLASS="li-itemize">Fault-tolerant: You can deploy an <TT>ejabberd</TT> cluster so that all the information required for a properly working service will be replicated permanently on all nodes. This means that if one of the nodes crashes, the others will continue working without disruption. In addition, nodes also can be added or replaced `on the fly'.<BR>
|
||||||
|
<BR>
|
||||||
|
<LI CLASS="li-itemize">Administrator Friendly: <TT>ejabberd</TT> is built on top of the Open Source Erlang. As a result you do not need to install an external database, an external web server, amongst others because everything is already included, and ready to run out of the box. Other administrator benefits include:
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Comprehensive documentation.
|
Comprehensive documentation.
|
||||||
</LI><LI CLASS="li-itemize">Straightforward installers for Linux, Mac OS X, and Windows. </LI><LI CLASS="li-itemize">Web interface for administration tasks.
|
<LI CLASS="li-itemize">Straightforward installers for Linux, Mac OS X, and Windows. <LI CLASS="li-itemize">Web interface for administration tasks.
|
||||||
</LI><LI CLASS="li-itemize">Shared Roster Groups.
|
<LI CLASS="li-itemize">Shared Roster Groups.
|
||||||
</LI><LI CLASS="li-itemize">Command line administration tool. </LI><LI CLASS="li-itemize">Can integrate with existing authentication mechanisms.
|
<LI CLASS="li-itemize">Command line administration tool. <LI CLASS="li-itemize">Can integrate with existing authentication mechanisms.
|
||||||
</LI><LI CLASS="li-itemize">Capability to send announce messages.
|
<LI CLASS="li-itemize">Capability to send announce messages.
|
||||||
</LI></UL></LI><LI CLASS="li-itemize">Internationalized: <TT>ejabberd</TT> leads in internationalization. Hence it is very well suited in a globalized world. Related features are:
|
</UL><BR>
|
||||||
|
<BR>
|
||||||
|
<LI CLASS="li-itemize">Internationalized: <TT>ejabberd</TT> leads in internationalization. Hence it is very well suited in a globalized world. Related features are:
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Translated in 12 languages. </LI><LI CLASS="li-itemize">Support for <A HREF="http://www.ietf.org/rfc/rfc3490.txt">IDNA</A>.
|
Translated in 12 languages. <LI CLASS="li-itemize">Support for <A HREF="http://www.ietf.org/rfc/rfc3490.txt">IDNA</A>.
|
||||||
</LI></UL></LI><LI CLASS="li-itemize">Open Standards: <TT>ejabberd</TT> is the first Open Source Jabber server claiming to fully comply to the XMPP standard.
|
</UL><BR>
|
||||||
|
<BR>
|
||||||
|
<LI CLASS="li-itemize">Open Standards: <TT>ejabberd</TT> is the first Open Source Jabber server claiming to fully comply to the XMPP standard.
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Fully XMPP compliant.
|
Fully XMPP compliant.
|
||||||
</LI><LI CLASS="li-itemize">XML-based protocol.
|
<LI CLASS="li-itemize">XML-based protocol.
|
||||||
</LI><LI CLASS="li-itemize"><A HREF="http://ejabberd.jabber.ru/protocols">Many protocols supported</A>.
|
<LI CLASS="li-itemize"><A HREF="http://www.ejabberd.im/protocols">Many protocols supported</A>.
|
||||||
</LI></UL></LI></UL><!--TOC section Additional Features-->
|
</UL></UL>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc2">2</A>  Additional Features</H2><!--SEC END --><P>
|
<!--TOC section Additional Features-->
|
||||||
|
|
||||||
|
<H2 CLASS="section"><A NAME="htoc2">2</A> Additional Features</H2><!--SEC END -->
|
||||||
|
|
||||||
<A NAME="addfeatures"></A>
|
<A NAME="addfeatures"></A>
|
||||||
</P><P>Moreover, <TT>ejabberd</TT> comes with a wide range of other state-of-the-art features:
|
|
||||||
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
|
Moreover, <TT>ejabberd</TT> comes with a wide range of other state-of-the-art features:
|
||||||
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Modular
|
Modular
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Load only the modules you want.
|
Load only the modules you want.
|
||||||
</LI><LI CLASS="li-itemize">Extend <TT>ejabberd</TT> with your own custom modules.
|
<LI CLASS="li-itemize">Extend <TT>ejabberd</TT> with your own custom modules.
|
||||||
</LI></UL>
|
</UL>
|
||||||
</LI><LI CLASS="li-itemize">Security
|
<LI CLASS="li-itemize">Security
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
SASL and STARTTLS for c2s and s2s connections.
|
SASL and STARTTLS for c2s and s2s connections.
|
||||||
</LI><LI CLASS="li-itemize">STARTTLS and Dialback s2s connections.
|
<LI CLASS="li-itemize">STARTTLS and Dialback s2s connections.
|
||||||
</LI><LI CLASS="li-itemize">Web interface accessible via HTTPS secure access.
|
<LI CLASS="li-itemize">Web interface accessible via HTTPS secure access.
|
||||||
</LI></UL>
|
</UL>
|
||||||
</LI><LI CLASS="li-itemize">Databases
|
<LI CLASS="li-itemize">Databases
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Native MySQL support.
|
Native MySQL support.
|
||||||
</LI><LI CLASS="li-itemize">Native PostgreSQL support.
|
<LI CLASS="li-itemize">Native PostgreSQL support.
|
||||||
</LI><LI CLASS="li-itemize">Mnesia.
|
<LI CLASS="li-itemize">Mnesia.
|
||||||
</LI><LI CLASS="li-itemize">ODBC data storage support.
|
<LI CLASS="li-itemize">ODBC data storage support.
|
||||||
</LI><LI CLASS="li-itemize">Microsoft SQL Server support. </LI></UL>
|
<LI CLASS="li-itemize">Microsoft SQL Server support. </UL>
|
||||||
</LI><LI CLASS="li-itemize">Authentication
|
<LI CLASS="li-itemize">Authentication
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
LDAP and ODBC. </LI><LI CLASS="li-itemize">External Authentication script.
|
LDAP and ODBC. <LI CLASS="li-itemize">External Authentication script.
|
||||||
</LI><LI CLASS="li-itemize">Internal Authentication.
|
<LI CLASS="li-itemize">Internal Authentication.
|
||||||
</LI></UL>
|
</UL>
|
||||||
</LI><LI CLASS="li-itemize">Others
|
<LI CLASS="li-itemize">Others
|
||||||
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
Compressing XML streams with Stream Compression (<A HREF="http://www.xmpp.org/extensions/xep-0138.html">XEP-0138</A>).
|
Compressing XML streams with Stream Compression (<A HREF="http://www.xmpp.org/extensions/xep-0138.html">XEP-0138</A>).
|
||||||
</LI><LI CLASS="li-itemize">Interface with networks such as AIM, ICQ and MSN.
|
<LI CLASS="li-itemize">Interface with networks such as AIM, ICQ and MSN.
|
||||||
</LI><LI CLASS="li-itemize">Statistics via Statistics Gathering (<A HREF="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</A>).
|
<LI CLASS="li-itemize">Statistics via Statistics Gathering (<A HREF="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</A>).
|
||||||
</LI><LI CLASS="li-itemize">IPv6 support both for c2s and s2s connections.
|
<LI CLASS="li-itemize">IPv6 support both for c2s and s2s connections.
|
||||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</A> module with logging. </LI><LI CLASS="li-itemize">Users Directory based on users vCards.
|
<LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</A> module with logging. <LI CLASS="li-itemize">Users Directory based on users vCards.
|
||||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component.
|
<LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component.
|
||||||
</LI><LI CLASS="li-itemize">Support for virtual hosting.
|
<LI CLASS="li-itemize">Support for virtual hosting.
|
||||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</A> service.
|
<LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</A> service.
|
||||||
</LI><LI CLASS="li-itemize">IRC transport.
|
<LI CLASS="li-itemize">IRC transport.
|
||||||
</LI></UL>
|
</UL>
|
||||||
</LI></UL><!--TOC section How it Works-->
|
</UL>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc3">3</A>  How it Works</H2><!--SEC END --><P>
|
|
||||||
<A NAME="howitworks"></A></P><P>A Jabber domain is served by one or more <TT>ejabberd</TT> nodes. These nodes can
|
<!--TOC section How it Works-->
|
||||||
|
|
||||||
|
<H2 CLASS="section"><A NAME="htoc3">3</A> How it Works</H2><!--SEC END -->
|
||||||
|
|
||||||
|
<A NAME="howitworks"></A>
|
||||||
|
A Jabber domain is served by one or more <TT>ejabberd</TT> nodes. These nodes can
|
||||||
be run on different machines that are connected via a network. They all must
|
be run on different machines that are connected via a network. They all must
|
||||||
have the ability to connect to port 4369 of all another nodes, and must have
|
have the ability to connect to port 4369 of all another nodes, and must have
|
||||||
the same magic cookie (see Erlang/OTP documentation, in other words the file
|
the same magic cookie (see Erlang/OTP documentation, in other words the file
|
||||||
<TT>~ejabberd/.erlang.cookie</TT> must be the same on all nodes). This is
|
<TT>~ejabberd/.erlang.cookie</TT> must be the same on all nodes). This is
|
||||||
needed because all nodes exchange information about connected users, S2S
|
needed because all nodes exchange information about connected users, S2S
|
||||||
connections, registered services, etc…</P><P>Each <TT>ejabberd</TT> node have following modules:
|
connections, registered services, etc...<BR>
|
||||||
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
|
<BR>
|
||||||
|
Each <TT>ejabberd</TT> node have following modules:
|
||||||
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
router;
|
router;
|
||||||
</LI><LI CLASS="li-itemize">local router.
|
<LI CLASS="li-itemize">local router.
|
||||||
</LI><LI CLASS="li-itemize">session manager;
|
<LI CLASS="li-itemize">session manager;
|
||||||
</LI><LI CLASS="li-itemize">S2S manager;
|
<LI CLASS="li-itemize">S2S manager;
|
||||||
</LI></UL><!--TOC subsection Router-->
|
</UL>
|
||||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc4">3.1</A>  Router</H3><!--SEC END --><P>This module is the main router of Jabber packets on each node. It routes
|
<!--TOC subsection Router-->
|
||||||
|
|
||||||
|
<H3 CLASS="subsection"><A NAME="htoc4">3.1</A> Router</H3><!--SEC END -->
|
||||||
|
|
||||||
|
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
|
them based on their destinations domains. It has two tables: local and global
|
||||||
routes. First, domain of packet destination searched in local table, and if it
|
routes. First, domain of packet destination searched in local table, and if it
|
||||||
found, then the packet is routed to appropriate process. If no, then it
|
found, then the packet is routed to appropriate process. If no, then it
|
||||||
searches in global table, and is routed to the appropriate <TT>ejabberd</TT> node or
|
searches in global table, and is routed to the appropriate <TT>ejabberd</TT> node or
|
||||||
process. If it does not exists in either tables, then it sent to the S2S
|
process. If it does not exists in either tables, then it sent to the S2S
|
||||||
manager.</P><!--TOC subsection Local Router-->
|
manager.<BR>
|
||||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc5">3.2</A>  Local Router</H3><!--SEC END --><P>This module routes packets which have a destination domain equal to this server
|
<BR>
|
||||||
|
<!--TOC subsection Local Router-->
|
||||||
|
|
||||||
|
<H3 CLASS="subsection"><A NAME="htoc5">3.2</A> Local Router</H3><!--SEC END -->
|
||||||
|
|
||||||
|
This module routes packets which have a destination domain equal to this server
|
||||||
name. If destination JID has a non-empty user part, then it routed to the
|
name. If destination JID has a non-empty user part, then it routed to the
|
||||||
session manager, else it is processed depending on it's content.</P><!--TOC subsection Session Manager-->
|
session manager, else it is processed depending on it's content.<BR>
|
||||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc6">3.3</A>  Session Manager</H3><!--SEC END --><P>This module routes packets to local users. It searches for what user resource
|
<BR>
|
||||||
|
<!--TOC subsection Session Manager-->
|
||||||
|
|
||||||
|
<H3 CLASS="subsection"><A NAME="htoc6">3.3</A> Session Manager</H3><!--SEC END -->
|
||||||
|
|
||||||
|
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
|
packet must be sended via presence table. If this resource is connected to
|
||||||
this node, it is routed to C2S process, if it connected via another node, then
|
this node, it is routed to C2S process, if it connected via another node, then
|
||||||
the packet is sent to session manager on that node.</P><!--TOC subsection S2S Manager-->
|
the packet is sent to session manager on that node.<BR>
|
||||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc7">3.4</A>  S2S Manager</H3><!--SEC END --><P>This module routes packets to other Jabber servers. First, it checks if an
|
<BR>
|
||||||
|
<!--TOC subsection S2S Manager-->
|
||||||
|
|
||||||
|
<H3 CLASS="subsection"><A NAME="htoc7">3.4</A> S2S Manager</H3><!--SEC END -->
|
||||||
|
|
||||||
|
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
|
open S2S connection from the domain of the packet source to the domain of
|
||||||
packet destination already exists. If it is open on another node, then it
|
packet destination already exists. If it is open on another node, then it
|
||||||
routes the packet to S2S manager on that node, if it is open on this node, then
|
routes the packet to S2S manager on that node, if it is open on this node, then
|
||||||
it is routed to the process that serves this connection, and if a connection
|
it is routed to the process that serves this connection, and if a connection
|
||||||
does not exist, then it is opened and registered.</P><!--TOC section XML Representation-->
|
does not exist, then it is opened and registered.<BR>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc8">4</A>  XML Representation</H2><!--SEC END --><P>
|
<BR>
|
||||||
<A NAME="xmlrepr"></A></P><P>Each XML stanza is represented as the following tuple:
|
<!--TOC section Authentication-->
|
||||||
</P><PRE CLASS="verbatim">XMLElement = {xmlelement, Name, Attrs, [ElementOrCDATA]}
|
|
||||||
|
<H2 CLASS="section"><A NAME="htoc8">4</A> Authentication</H2><!--SEC END -->
|
||||||
|
|
||||||
|
<!--TOC subsubsection External-->
|
||||||
|
|
||||||
|
<H4 CLASS="subsubsection"><A NAME="htoc9">4.0.1</A> External</H4><!--SEC END -->
|
||||||
|
|
||||||
|
<A NAME="externalauth"></A>
|
||||||
|
|
||||||
|
The external authentication script follows
|
||||||
|
<A HREF="http://www.erlang.org/doc/tutorial/c_portdriver.html">the erlang port driver API</A>.<BR>
|
||||||
|
<BR>
|
||||||
|
That script is supposed to do theses actions, in an infinite loop:
|
||||||
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
|
read from stdin: AABBBBBBBBB.....
|
||||||
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
|
A: 2 bytes of length data (a short in network byte order)
|
||||||
|
<LI CLASS="li-itemize">B: a string of length found in A that contains operation in plain text
|
||||||
|
operation are as follows:
|
||||||
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
|
auth:User:Server:Password (check if a username/password pair is correct)
|
||||||
|
<LI CLASS="li-itemize">isuser:User:Server (check if it's a valid user)
|
||||||
|
<LI CLASS="li-itemize">setpass:User:Server:Password (set user's password)
|
||||||
|
</UL>
|
||||||
|
</UL>
|
||||||
|
<LI CLASS="li-itemize">write to stdout: AABB
|
||||||
|
<UL CLASS="itemize"><LI CLASS="li-itemize">
|
||||||
|
A: the number 2 (coded as a short, which is bytes length of following result)
|
||||||
|
<LI CLASS="li-itemize">B: the result code (coded as a short), should be 1 for success/valid, or 0 for failure/invalid
|
||||||
|
</UL>
|
||||||
|
</UL>
|
||||||
|
Example python script
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from struct import *
|
||||||
|
|
||||||
|
def from_ejabberd():
|
||||||
|
input_length = sys.stdin.read(2)
|
||||||
|
(size,) = unpack('>h', input_length)
|
||||||
|
return sys.stdin.read(size).split(':')
|
||||||
|
|
||||||
|
def to_ejabberd(bool):
|
||||||
|
answer = 0
|
||||||
|
if bool:
|
||||||
|
answer = 1
|
||||||
|
token = pack('>hh', 2, answer)
|
||||||
|
sys.stdout.write(token)
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
def auth(username, server, password):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def isuser(username, server):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def setpass(username, server, password):
|
||||||
|
return True
|
||||||
|
|
||||||
|
while True:
|
||||||
|
data = from_ejabberd()
|
||||||
|
success = False
|
||||||
|
if data[0] == "auth":
|
||||||
|
success = auth(data[1], data[2], data[3])
|
||||||
|
elif data[0] == "isuser":
|
||||||
|
success = isuser(data[1], data[2])
|
||||||
|
elif data[0] == "setpass":
|
||||||
|
success = setpass(data[1], data[2], data[3])
|
||||||
|
to_ejabberd(success)
|
||||||
|
</PRE>
|
||||||
|
<!--TOC section XML Representation-->
|
||||||
|
|
||||||
|
<H2 CLASS="section"><A NAME="htoc10">5</A> XML Representation</H2><!--SEC END -->
|
||||||
|
|
||||||
|
<A NAME="xmlrepr"></A>
|
||||||
|
Each XML stanza is represented as the following tuple:
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
XMLElement = {xmlelement, Name, Attrs, [ElementOrCDATA]}
|
||||||
Name = string()
|
Name = string()
|
||||||
Attrs = [Attr]
|
Attrs = [Attr]
|
||||||
Attr = {Key, Val}
|
Attr = {Key, Val}
|
||||||
@ -183,30 +320,45 @@ does not exist, then it is opened and registered.</P><!--TOC section XML Represe
|
|||||||
Val = string()
|
Val = string()
|
||||||
ElementOrCDATA = XMLElement | CDATA
|
ElementOrCDATA = XMLElement | CDATA
|
||||||
CDATA = {xmlcdata, string()}
|
CDATA = {xmlcdata, string()}
|
||||||
</PRE><P>E. g. this stanza:
|
</PRE>E. g. this stanza:
|
||||||
</P><PRE CLASS="verbatim"><message to='test@conference.example.org' type='groupchat'>
|
<PRE CLASS="verbatim">
|
||||||
|
<message to='test@conference.example.org' type='groupchat'>
|
||||||
<body>test</body>
|
<body>test</body>
|
||||||
</message>
|
</message>
|
||||||
</PRE><P>is represented as the following structure:
|
</PRE>is represented as the following structure:
|
||||||
</P><PRE CLASS="verbatim">{xmlelement, "message",
|
<PRE CLASS="verbatim">
|
||||||
|
{xmlelement, "message",
|
||||||
[{"to", "test@conference.example.org"},
|
[{"to", "test@conference.example.org"},
|
||||||
{"type", "groupchat"}],
|
{"type", "groupchat"}],
|
||||||
[{xmlelement, "body",
|
[{xmlelement, "body",
|
||||||
[],
|
[],
|
||||||
[{xmlcdata, "test"}]}]}}
|
[{xmlcdata, "test"}]}]}}
|
||||||
</PRE><!--TOC section Module <TT>xml</TT>-->
|
</PRE>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc9">5</A>  Module <TT>xml</TT></H2><!--SEC END --><P>
|
<!--TOC section Module <TT>xml</TT>-->
|
||||||
<A NAME="xmlmod"></A></P><DL CLASS="description"><DT CLASS="dt-description">
|
|
||||||
</DT><DD CLASS="dd-description"><CODE>element_to_string(El) -> string()</CODE>
|
<H2 CLASS="section"><A NAME="htoc11">6</A> Module <TT>xml</TT></H2><!--SEC END -->
|
||||||
<PRE CLASS="verbatim">El = XMLElement
|
|
||||||
</PRE>Returns string representation of XML stanza <TT>El</TT>.</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>crypt(S) -> string()</CODE>
|
<A NAME="xmlmod"></A>
|
||||||
<PRE CLASS="verbatim">S = string()
|
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>element_to_string(El) -> string()</CODE>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
El = XMLElement
|
||||||
|
</PRE>Returns string representation of XML stanza <TT>El</TT>.<BR>
|
||||||
|
<BR>
|
||||||
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>crypt(S) -> string()</CODE>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
S = string()
|
||||||
</PRE>Returns string which correspond to <TT>S</TT> with encoded XML special
|
</PRE>Returns string which correspond to <TT>S</TT> with encoded XML special
|
||||||
characters.</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>remove_cdata(ECList) -> EList</CODE>
|
characters.<BR>
|
||||||
<PRE CLASS="verbatim">ECList = [ElementOrCDATA]
|
<BR>
|
||||||
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>remove_cdata(ECList) -> EList</CODE>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
ECList = [ElementOrCDATA]
|
||||||
EList = [XMLElement]
|
EList = [XMLElement]
|
||||||
</PRE><TT>EList</TT> is a list of all non-CDATA elements of ECList.</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>get_path_s(El, Path) -> Res</CODE>
|
</PRE><TT>EList</TT> is a list of all non-CDATA elements of ECList.<BR>
|
||||||
<PRE CLASS="verbatim">El = XMLElement
|
<BR>
|
||||||
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>get_path_s(El, Path) -> Res</CODE>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
El = XMLElement
|
||||||
Path = [PathItem]
|
Path = [PathItem]
|
||||||
PathItem = PathElem | PathAttr | PathCDATA
|
PathItem = PathElem | PathAttr | PathCDATA
|
||||||
PathElem = {elem, Name}
|
PathElem = {elem, Name}
|
||||||
@ -215,56 +367,74 @@ PathCDATA = cdata
|
|||||||
Name = string()
|
Name = string()
|
||||||
Res = string() | XMLElement
|
Res = string() | XMLElement
|
||||||
</PRE>If <TT>Path</TT> is empty, then returns <TT>El</TT>. Else sequentially
|
</PRE>If <TT>Path</TT> is empty, then returns <TT>El</TT>. Else sequentially
|
||||||
consider elements of <TT>Path</TT>. Each element is one of:
|
consider elements of <TT>Path</TT>. Each element is one of:
|
||||||
<DL CLASS="description"><DT CLASS="dt-description">
|
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>{elem, Name}</CODE> <TT>Name</TT> is name of subelement of
|
||||||
</DT><DD CLASS="dd-description"><CODE>{elem, Name}</CODE> <TT>Name</TT> is name of subelement of
|
<TT>El</TT>, if such element exists, then this element considered in
|
||||||
<TT>El</TT>, if such element exists, then this element considered in
|
following steps, else returns empty string.
|
||||||
following steps, else returns empty string.
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>{attr, Name}</CODE> If <TT>El</TT> have attribute <TT>Name</TT>, then
|
||||||
</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>{attr, Name}</CODE> If <TT>El</TT> have attribute <TT>Name</TT>, then
|
returns value of this attribute, else returns empty string.
|
||||||
returns value of this attribute, else returns empty string.
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>cdata</CODE> Returns CDATA of <TT>El</TT>.
|
||||||
</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>cdata</CODE> Returns CDATA of <TT>El</TT>.
|
</DL><BR>
|
||||||
</DD></DL></DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description">TODO:
|
<BR>
|
||||||
<PRE CLASS="verbatim"> get_cdata/1, get_tag_cdata/1
|
<DT CLASS="dt-description"><DD CLASS="dd-description">TODO:
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
get_cdata/1, get_tag_cdata/1
|
||||||
get_attr/2, get_attr_s/2
|
get_attr/2, get_attr_s/2
|
||||||
get_tag_attr/2, get_tag_attr_s/2
|
get_tag_attr/2, get_tag_attr_s/2
|
||||||
get_subtag/2
|
get_subtag/2
|
||||||
</PRE></DD></DL><!--TOC section Module <TT>xml_stream</TT>-->
|
</PRE></DL>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc10">6</A>  Module <TT>xml_stream</TT></H2><!--SEC END --><P>
|
<!--TOC section Module <TT>xml_stream</TT>-->
|
||||||
<A NAME="xmlstreammod"></A></P><DL CLASS="description"><DT CLASS="dt-description">
|
|
||||||
</DT><DD CLASS="dd-description"><CODE>parse_element(Str) -> XMLElement | {error, Err}</CODE>
|
<H2 CLASS="section"><A NAME="htoc12">7</A> Module <TT>xml_stream</TT></H2><!--SEC END -->
|
||||||
<PRE CLASS="verbatim">Str = string()
|
|
||||||
|
<A NAME="xmlstreammod"></A>
|
||||||
|
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>parse_element(Str) -> XMLElement | {error, Err}</CODE>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
Str = string()
|
||||||
Err = term()
|
Err = term()
|
||||||
</PRE>Parses <TT>Str</TT> using XML parser, returns either parsed element or error
|
</PRE>Parses <TT>Str</TT> using XML parser, returns either parsed element or error
|
||||||
tuple.
|
tuple.
|
||||||
</DD></DL><!--TOC section Modules-->
|
</DL>
|
||||||
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc11">7</A>  Modules</H2><!--SEC END --><P>
|
<!--TOC section Modules-->
|
||||||
<A NAME="emods"></A></P><!--TOC subsection Module gen_iq_handler-->
|
|
||||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc12">7.1</A>  Module gen_iq_handler</H3><!--SEC END --><P>
|
<H2 CLASS="section"><A NAME="htoc13">8</A> Modules</H2><!--SEC END -->
|
||||||
<A NAME="geniqhandl"></A></P><P>The module <CODE>gen_iq_handler</CODE> allows to easily write handlers for IQ packets
|
|
||||||
of particular XML namespaces that addressed to server or to users bare JIDs.</P><P>In this module the following functions are defined:
|
<A NAME="emods"></A>
|
||||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
<!--TOC subsection Module gen_iq_handler-->
|
||||||
</DT><DD CLASS="dd-description"><CODE>add_iq_handler(Component, Host, NS, Module, Function, Type)</CODE>
|
|
||||||
<PRE CLASS="verbatim">Component = Module = Function = atom()
|
<H3 CLASS="subsection"><A NAME="htoc14">8.1</A> Module gen_iq_handler</H3><!--SEC END -->
|
||||||
|
|
||||||
|
<A NAME="geniqhandl"></A>
|
||||||
|
The module <CODE>gen_iq_handler</CODE> allows to easily write handlers for IQ packets
|
||||||
|
of particular XML namespaces that addressed to server or to users bare JIDs.<BR>
|
||||||
|
<BR>
|
||||||
|
In this module the following functions are defined:
|
||||||
|
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>add_iq_handler(Component, Host, NS, Module, Function, Type)</CODE>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
Component = Module = Function = atom()
|
||||||
Host = NS = string()
|
Host = NS = string()
|
||||||
Type = no_queue | one_queue | parallel
|
Type = no_queue | one_queue | parallel
|
||||||
</PRE>Registers function <CODE>Module:Function</CODE> as handler for IQ packets on
|
</PRE>Registers function <CODE>Module:Function</CODE> as handler for IQ packets on
|
||||||
virtual host <CODE>Host</CODE> that contain child of namespace <CODE>NS</CODE> in
|
virtual host <CODE>Host</CODE> that contain child of namespace <CODE>NS</CODE> in
|
||||||
<CODE>Component</CODE>. Queueing discipline is <CODE>Type</CODE>. There are at least
|
<CODE>Component</CODE>. Queueing discipline is <CODE>Type</CODE>. There are at least
|
||||||
two components defined:
|
two components defined:
|
||||||
<DL CLASS="description"><DT CLASS="dt-description">
|
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>ejabberd_local</CODE> Handles packets that addressed to server JID;
|
||||||
</DT><DD CLASS="dd-description"><CODE>ejabberd_local</CODE> Handles packets that addressed to server JID;
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>ejabberd_sm</CODE> Handles packets that addressed to users bare JIDs.
|
||||||
</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>ejabberd_sm</CODE> Handles packets that addressed to users bare JIDs.
|
</DL>
|
||||||
</DD></DL>
|
<DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>remove_iq_handler(Component, Host, NS)</CODE>
|
||||||
</DD><DT CLASS="dt-description"></DT><DD CLASS="dd-description"><CODE>remove_iq_handler(Component, Host, NS)</CODE>
|
<PRE CLASS="verbatim">
|
||||||
<PRE CLASS="verbatim">Component = atom()
|
Component = atom()
|
||||||
Host = NS = string()
|
Host = NS = string()
|
||||||
</PRE>Removes IQ handler on virtual host <CODE>Host</CODE> for namespace <CODE>NS</CODE> from
|
</PRE>Removes IQ handler on virtual host <CODE>Host</CODE> for namespace <CODE>NS</CODE> from
|
||||||
<CODE>Component</CODE>.
|
<CODE>Component</CODE>.
|
||||||
</DD></DL><P>Handler function must have the following type:
|
</DL>
|
||||||
</P><DL CLASS="description"><DT CLASS="dt-description">
|
Handler function must have the following type:
|
||||||
</DT><DD CLASS="dd-description"><CODE>Module:Function(From, To, IQ)</CODE>
|
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><DD CLASS="dd-description"><CODE>Module:Function(From, To, IQ)</CODE>
|
||||||
<PRE CLASS="verbatim">From = To = jid()
|
<PRE CLASS="verbatim">
|
||||||
</PRE></DD></DL><PRE CLASS="verbatim">-module(mod_cputime).
|
From = To = jid()
|
||||||
|
</PRE></DL>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
-module(mod_cputime).
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
-behaviour(gen_mod).
|
||||||
|
|
||||||
@ -298,9 +468,14 @@ process_local_iq(From, To, {iq, ID, Type, XMLNS, SubEl}) ->
|
|||||||
[{"xmlns", ?NS_CPUTIME}],
|
[{"xmlns", ?NS_CPUTIME}],
|
||||||
[{xmlelement, "cputime", [], [{xmlcdata, SCPUTime}]}]}]}
|
[{xmlelement, "cputime", [], [{xmlcdata, SCPUTime}]}]}]}
|
||||||
end.
|
end.
|
||||||
</PRE><!--TOC subsection Services-->
|
</PRE>
|
||||||
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc13">7.2</A>  Services</H3><!--SEC END --><P>
|
<!--TOC subsection Services-->
|
||||||
<A NAME="services"></A></P><PRE CLASS="verbatim">-module(mod_echo).
|
|
||||||
|
<H3 CLASS="subsection"><A NAME="htoc15">8.2</A> Services</H3><!--SEC END -->
|
||||||
|
|
||||||
|
<A NAME="services"></A>
|
||||||
|
<PRE CLASS="verbatim">
|
||||||
|
-module(mod_echo).
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
-behaviour(gen_mod).
|
||||||
|
|
||||||
@ -334,10 +509,10 @@ stop(Host) ->
|
|||||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
||||||
Proc ! stop,
|
Proc ! stop,
|
||||||
{wait, Proc}.
|
{wait, Proc}.
|
||||||
</PRE><!--CUT END -->
|
</PRE>
|
||||||
<!--HTMLFOOT-->
|
<!--HTMLFOOT-->
|
||||||
<!--ENDHTML-->
|
<!--ENDHTML-->
|
||||||
<!--FOOTER-->
|
<!--FOOTER-->
|
||||||
<HR SIZE=2><BLOCKQUOTE CLASS="quote"><EM>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
|
<HR SIZE=2><BLOCKQUOTE CLASS="quote"><EM>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
|
||||||
</EM><A HREF="http://hevea.inria.fr/index.html"><EM>H</EM><EM><FONT SIZE=2><sup>E</sup></FONT></EM><EM>V</EM><EM><FONT SIZE=2><sup>E</sup></FONT></EM><EM>A</EM></A><EM>.</EM></BLOCKQUOTE></BODY>
|
</EM><A HREF="http://pauillac.inria.fr/~maranget/hevea/index.html"><EM>H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</EM></A><EM>.</EM></BLOCKQUOTE></BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
4618
doc/guide.html
4618
doc/guide.html
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,2 @@
|
|||||||
% ejabberd version (automatically generated).
|
% ejabberd version (automatically generated).
|
||||||
|
\newcommand{\version}{2.0.0b1}
|
||||||
ewcommand{ersion}{2.0.0b1}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user