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