<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 10. RPC Pluggable Modules</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt03.html" title="Part III. Samba Subsystems"><link rel="previous" href="pt03.html" title="Part III. Samba Subsystems"><link rel="next" href="vfs.html" title="Chapter 11. 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 10. 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 10. 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><tt class="email"><<a href="mailto:aliguor@us.ibm.com">aliguor@us.ibm.com</a>></tt></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><tt class="email"><<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>></tt></p></div></div></div></div><div><p class="pubdate">January 2003</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="rpc-plugin.html#id2515845">About</a></span></dt><dt><span class="sect1"><a href="rpc-plugin.html#id2515861">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="id2515845"></a>About</h2></div></div><div></div></div><p> 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. </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2515861"></a>General Overview</h2></div></div><div></div></div><p> When an RPC call is sent to smbd, smbd tries to load a shared library by the name <tt class="filename">librpc_<pipename>.so</tt> to handle the call if it doesn't know how to handle the call internally. For instance, LSA calls are handled by <tt class="filename">librpc_lsass.so</tt>.. These shared libraries should be located in the <tt class="filename"><sambaroot>/lib/rpc</tt>. smbd then attempts to call the init_module function within the shared library. Check the chapter on modules for more information. </p><p> In the init_module function, the library should call rpc_pipe_register_commands(). This function takes the following arguments: </p><pre class="programlisting"> NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, const struct api_struct *cmds, int size); </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 argument.</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> See rpc_server/srv_reg.c and rpc_server/srv_reg_nt.c for a small example of how to use this library. </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 11. VFS Modules</td></tr></table></div></body></html>