1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�9.�RPC Pluggable Modules</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt03.html" title="Part�III.�Samba Subsystems"><link rel="prev" href="pt03.html" title="Part�III.�Samba Subsystems"><link rel="next" href="vfs.html" title="Chapter�10.�VFS Modules"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�9.�RPC Pluggable Modules</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pt03.html">Prev</a>�</td><th width="60%" align="center">Part�III.�Samba Subsystems</th><td width="20%" align="right">�<a accesskey="n" href="vfs.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="rpc-plugin"></a>Chapter�9.�RPC Pluggable Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Anthony</span> <span class="surname">Liguori</span></h3><div class="affiliation"><span class="orgname">IBM<br></span><div class="address"><p><code class="email"><<a href="mailto:aliguor@us.ibm.com">aliguor@us.ibm.com</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">January 2003</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="rpc-plugin.html#id324517">About</a></span></dt><dt><span class="sect1"><a href="rpc-plugin.html#id324530">General Overview</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id324517"></a>About</h2></div></div></div><p> 2This document describes how to make use the new RPC Pluggable Modules features 3of Samba 3.0. This architecture was added to increase the maintainability of 4Samba allowing RPC Pipes to be worked on separately from the main CVS branch. 5The RPM architecture will also allow third-party vendors to add functionality 6to Samba through plug-ins. 7</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id324530"></a>General Overview</h2></div></div></div><p> 8When an RPC call is sent to smbd, smbd tries to load a shared library by the 9name <code class="filename">librpc_<pipename>.so</code> to handle the call if 10it doesn't know how to handle the call internally. For instance, LSA calls 11are handled by <code class="filename">librpc_lsass.so</code>.. 12These shared libraries should be located in the <code class="filename"><sambaroot>/lib/rpc</code>. smbd then attempts to call the init_module function within 13the shared library. Check the chapter on modules for more information. 14</p><p> 15In the init_module function, the library should call 16rpc_pipe_register_commands(). This function takes the following arguments: 17</p><pre class="programlisting"> 18NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, 19 const struct api_struct *cmds, int size); 20</pre><div class="variablelist"><dl><dt><span class="term">version</span></dt><dd><p>Version number of the RPC interface. Use the define <span class="emphasis"><em>SMB_RPC_INTERFACE_VERSION</em></span> for this 21argument.</p></dd><dt><span class="term">clnt</span></dt><dd><p>the Client name of the named pipe</p></dd><dt><span class="term">srv</span></dt><dd><p>the Server name of the named pipe</p></dd><dt><span class="term">cmds</span></dt><dd><p>a list of api_structs that map RPC ordinal numbers to function calls</p></dd><dt><span class="term">size</span></dt><dd><p>the number of api_structs contained in cmds</p></dd></dl></div><p> 22See rpc_server/srv_reg.c and rpc_server/srv_reg_nt.c for a small example of 23how to use this library. 24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pt03.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="pt03.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="vfs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part�III.�Samba Subsystems�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�10.�VFS Modules</td></tr></table></div></body></html> 25