Some update and Fixes for typos.
[kai/samba.git] / docs / docbook / devdoc / rpc_plugin.sgml
1 <chapter id="rpc-plugin">
2 <chapterinfo>
3         <author>
4                 <firstname>Anthony</firstname><surname>Liguori</surname>
5                 <affiliation>
6                         <orgname>IBM</orgname>
7                         <address><email>aliguor@us.ibm.com</email></address>
8                 </affiliation>
9         </author>
10         <author>
11                 <firstname>Jelmer</firstname><surname>Vernooij</surname>
12                 <affiliation>
13                         <orgname>Samba Team</orgname>
14                         <address><email>jelmer@samba.org</email></address>
15                 </affiliation>
16         </author>
17         <pubdate>January 2003</pubdate>
18 </chapterinfo>
19
20 <title>RPC Pluggable Modules</title>
21
22 <sect1>
23 <title>About</title>
24
25 <para>
26 This document describes how to make use the new RPC Pluggable Modules features
27 of Samba 3.0.  This architecture was added to increase the maintainability of
28 Samba allowing RPC Pipes to be worked on separately from the main CVS branch.
29 The RPM architecture will also allow third-party vendors to add functionality
30 to Samba through plug-ins.
31 </para>
32
33 </sect1>
34
35 <sect1>
36 <title>General Overview</title>
37
38 <para>
39 When an RPC call is sent to smbd, smbd tries to load a shared library by the
40 name <filename>librpc_&lt;pipename&gt;.so</filename> to handle the call if
41 it doesn't know how to handle the call internally.  For instance, LSA calls
42 are handled by <filename>librpc_lsass.so</filename>..
43 These shared libraries should be located in the <filename>&lt;sambaroot&gt;/lib/rpc</filename>.  smbd then attempts to call the init_module function within
44 the shared library. Check the chapter on modules for more information.
45 </para>
46
47 <para>
48 In the init_module function, the library should call 
49 rpc_pipe_register_commands().  This function takes the following arguments:
50 </para>
51
52 <para><programlisting>
53 int rpc_pipe_register_commands(const char *clnt, const char *srv,
54                                const struct api_struct *cmds, int size);
55 </programlisting></para>
56
57 <variablelist>
58
59 <varlistentry><term>clnt</term>
60 <listitem><para>the Client name of the named pipe</para></listitem>
61 </varlistentry>
62
63 <varlistentry><term>srv</term>
64 <listitem><para>the Server name of the named pipe</para></listitem>
65 </varlistentry>
66
67 <varlistentry><term>cmds</term>
68 <listitem><para>a list of api_structs that map RPC ordinal numbers to function calls</para></listitem>
69 </varlistentry>
70
71 <varlistentry><term>size</term>
72 <listitem><para>the number of api_structs contained in cmds</para></listitem>
73 </varlistentry>
74
75 </variablelist>
76
77 <para>
78 See rpc_server/srv_reg.c and rpc_server/srv_reg_nt.c for a small example of
79 how to use this library.
80 </para>
81
82 </sect1>
83 </chapter>