- Timestamp:
- May 20, 2009, 6:46:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/docs/htmldocs/Samba3-Developers-Guide/internals.html
r149 r204 1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 5. Samba Internals</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.1"><link rel="start" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="debug.html" title="Chapter 4. The samba DEBUG system"><link rel="next" href="CodingSuggestions.html" title="Chapter 6. Coding Suggestions"></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 5. Samba Internals</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="CodingSuggestions.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="internals"></a>Chapter 5. Samba Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="surname">Chappell</span></h3><div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:David.Chappell@mail.trincoll.edu">David.Chappell@mail.trincoll.edu</a>></code></p></div></div></div></div><div><p class="pubdate">8 May 1996</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="internals.html#id254979 0">Character Handling</a></span></dt><dt><span class="sect1"><a href="internals.html#id2549812">The new functions</a></span></dt><dt><span class="sect1"><a href="internals.html#id2549942">Macros in byteorder.h</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2549954">CVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2549965">PVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2549976">SCVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2549987">SVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550000">IVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550012">SVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550024">IVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550036">SSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550047">SIVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550059">SSVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550071">SIVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550083">RSVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550095">RIVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550106">RSSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550119">RSIVAL(buf,pos,val)</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2550132">LAN Manager Samba API</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2550160">Parameters</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550286">Return value</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2550358">Code character table</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2549790"></a>Character Handling</h2></div></div></div><p>1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 5. Samba Internals</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.1"><link rel="start" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="debug.html" title="Chapter 4. The samba DEBUG system"><link rel="next" href="CodingSuggestions.html" title="Chapter 6. Coding Suggestions"></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 5. Samba Internals</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="CodingSuggestions.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="internals"></a>Chapter 5. Samba Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="surname">Chappell</span></h3><div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:David.Chappell@mail.trincoll.edu">David.Chappell@mail.trincoll.edu</a>></code></p></div></div></div></div><div><p class="pubdate">8 May 1996</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="internals.html#id2549794">Character Handling</a></span></dt><dt><span class="sect1"><a href="internals.html#id2549816">The new functions</a></span></dt><dt><span class="sect1"><a href="internals.html#id2549947">Macros in byteorder.h</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2549958">CVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2549969">PVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2549980">SCVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2549991">SVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550004">IVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550016">SVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550028">IVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550040">SSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550052">SIVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550063">SSVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550075">SIVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550087">RSVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550099">RIVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550110">RSSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550123">RSIVAL(buf,pos,val)</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2550136">LAN Manager Samba API</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2550164">Parameters</a></span></dt><dt><span class="sect2"><a href="internals.html#id2550290">Return value</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2550362">Code character table</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2549794"></a>Character Handling</h2></div></div></div><p> 2 2 This section describes character set handling in Samba, as implemented in 3 3 Samba 3.0 and above … … 9 9 codepage. This led to a nightmare of code that tried to cope with 10 10 particular cases without handlingt the general case. 11 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id254981 2"></a>The new functions</h2></div></div></div><p>11 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2549816"></a>The new functions</h2></div></div></div><p> 12 12 The new system works like this: 13 13 </p><div class="orderedlist"><ol type="1"><li><p> … … 71 71 </p></li><li><p> 72 72 all vfs functions take unix strings. Don't convert when passing to them 73 </p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id254994 2"></a>Macros in byteorder.h</h2></div></div></div><p>73 </p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2549947"></a>Macros in byteorder.h</h2></div></div></div><p> 74 74 This section describes the macros defined in byteorder.h. These macros 75 75 are used extensively in the Samba code. 76 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id254995 4"></a>CVAL(buf,pos)</h3></div></div></div><p>76 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549958"></a>CVAL(buf,pos)</h3></div></div></div><p> 77 77 returns the byte at offset pos within buffer buf as an unsigned character. 78 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id254996 5"></a>PVAL(buf,pos)</h3></div></div></div><p>returns the value of CVAL(buf,pos) cast to type unsigned integer.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549976"></a>SCVAL(buf,pos,val)</h3></div></div></div><p>sets the byte at offset pos within buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549987"></a>SVAL(buf,pos)</h3></div></div></div><p>78 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549969"></a>PVAL(buf,pos)</h3></div></div></div><p>returns the value of CVAL(buf,pos) cast to type unsigned integer.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549980"></a>SCVAL(buf,pos,val)</h3></div></div></div><p>sets the byte at offset pos within buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549991"></a>SVAL(buf,pos)</h3></div></div></div><p> 79 79 returns the value of the unsigned short (16 bit) little-endian integer at 80 80 offset pos within buffer buf. An integer of this type is sometimes 81 81 refered to as "USHORT". 82 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255000 0"></a>IVAL(buf,pos)</h3></div></div></div><p>returns the value of the unsigned 32 bit little-endian integer at offset83 pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255001 2"></a>SVALS(buf,pos)</h3></div></div></div><p>returns the value of the signed short (16 bit) little-endian integer at84 offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255002 4"></a>IVALS(buf,pos)</h3></div></div></div><p>returns the value of the signed 32 bit little-endian integer at offset pos85 within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25500 36"></a>SSVAL(buf,pos,val)</h3></div></div></div><p>sets the unsigned short (16 bit) little-endian integer at offset pos within86 buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25500 47"></a>SIVAL(buf,pos,val)</h3></div></div></div><p>sets the unsigned 32 bit little-endian integer at offset pos within buffer87 buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25500 59"></a>SSVALS(buf,pos,val)</h3></div></div></div><p>sets the short (16 bit) signed little-endian integer at offset pos within88 buffer buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255007 1"></a>SIVALS(buf,pos,val)</h3></div></div></div><p>sets the signed 32 bit little-endian integer at offset pos withing buffer89 buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255008 3"></a>RSVAL(buf,pos)</h3></div></div></div><p>returns the value of the unsigned short (16 bit) big-endian integer at90 offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255009 5"></a>RIVAL(buf,pos)</h3></div></div></div><p>returns the value of the unsigned 32 bit big-endian integer at offset91 pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25501 06"></a>RSSVAL(buf,pos,val)</h3></div></div></div><p>sets the value of the unsigned short (16 bit) big-endian integer at82 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550004"></a>IVAL(buf,pos)</h3></div></div></div><p>returns the value of the unsigned 32 bit little-endian integer at offset 83 pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550016"></a>SVALS(buf,pos)</h3></div></div></div><p>returns the value of the signed short (16 bit) little-endian integer at 84 offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550028"></a>IVALS(buf,pos)</h3></div></div></div><p>returns the value of the signed 32 bit little-endian integer at offset pos 85 within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550040"></a>SSVAL(buf,pos,val)</h3></div></div></div><p>sets the unsigned short (16 bit) little-endian integer at offset pos within 86 buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550052"></a>SIVAL(buf,pos,val)</h3></div></div></div><p>sets the unsigned 32 bit little-endian integer at offset pos within buffer 87 buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550063"></a>SSVALS(buf,pos,val)</h3></div></div></div><p>sets the short (16 bit) signed little-endian integer at offset pos within 88 buffer buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550075"></a>SIVALS(buf,pos,val)</h3></div></div></div><p>sets the signed 32 bit little-endian integer at offset pos withing buffer 89 buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550087"></a>RSVAL(buf,pos)</h3></div></div></div><p>returns the value of the unsigned short (16 bit) big-endian integer at 90 offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550099"></a>RIVAL(buf,pos)</h3></div></div></div><p>returns the value of the unsigned 32 bit big-endian integer at offset 91 pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550110"></a>RSSVAL(buf,pos,val)</h3></div></div></div><p>sets the value of the unsigned short (16 bit) big-endian integer at 92 92 offset pos within buffer buf to value val. 93 refered to as "USHORT".</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25501 19"></a>RSIVAL(buf,pos,val)</h3></div></div></div><p>sets the value of the unsigned 32 bit big-endian integer at offset94 pos within buffer buf to value val.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id255013 2"></a>LAN Manager Samba API</h2></div></div></div><p>93 refered to as "USHORT".</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550123"></a>RSIVAL(buf,pos,val)</h3></div></div></div><p>sets the value of the unsigned 32 bit big-endian integer at offset 94 pos within buffer buf to value val.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2550136"></a>LAN Manager Samba API</h2></div></div></div><p> 95 95 This section describes the functions need to make a LAN Manager RPC call. 96 96 This information had been obtained by examining the Samba code and the LAN … … 105 105 This function is defined in client.c. It uses an SMB transaction to call a 106 106 remote api. 107 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id255016 0"></a>Parameters</h3></div></div></div><p>The parameters are as follows:</p><div class="orderedlist"><ol type="1"><li><p>107 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550164"></a>Parameters</h3></div></div></div><p>The parameters are as follows:</p><div class="orderedlist"><ol type="1"><li><p> 108 108 prcnt: the number of bytes of parameters begin sent. 109 109 </p></li><li><p> … … 150 150 The code in client.c always calls call_api() with no data. It is unclear 151 151 when a non-zero length data buffer would be sent. 152 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25502 86"></a>Return value</h3></div></div></div><p>152 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2550290"></a>Return value</h3></div></div></div><p> 153 153 The returned parameters (pointed to by rparam), in their order of appearance 154 154 are:</p><div class="orderedlist"><ol type="1"><li><p> … … 181 181 do with indicating the amount of data returned or possibly the amount of 182 182 data which can be returned if enough buffer space is allowed. 183 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id25503 58"></a>Code character table</h2></div></div></div><p>183 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2550362"></a>Code character table</h2></div></div></div><p> 184 184 Certain data structures are described by means of ASCIIz strings containing 185 185 code characters. These are the code characters:
Note:
See TracChangeset
for help on using the changeset viewer.