- Timestamp:
- Sep 30, 2008, 7:14:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/docs/htmldocs/Samba3-Developers-Guide/internals.html
r134 r158 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.2"><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#id3 46925">Character Handling</a></span></dt><dt><span class="sect1"><a href="internals.html#id346942">The new functions</a></span></dt><dt><span class="sect1"><a href="internals.html#id347046">Macros in byteorder.h</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id347056">CVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347066">PVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347076">SCVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347087">SVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347098">IVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347108">SVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347119">IVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347130">SSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347140">SIVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347151">SSVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347161">SIVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347172">RSVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347182">RIVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347193">RSSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id347204">RSIVAL(buf,pos,val)</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id347215">LAN Manager Samba API</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id347239">Parameters</a></span></dt><dt><span class="sect2"><a href="internals.html#id347345">Return value</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id347402">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="id346925"></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.2"><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#id321359">Character Handling</a></span></dt><dt><span class="sect1"><a href="internals.html#id321376">The new functions</a></span></dt><dt><span class="sect1"><a href="internals.html#id321480">Macros in byteorder.h</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id321490">CVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321500">PVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321510">SCVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321520">SVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321532">IVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321542">SVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321553">IVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321563">SSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321574">SIVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321584">SSVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321595">SIVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321605">RSVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321616">RIVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321626">RSSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id321637">RSIVAL(buf,pos,val)</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id321649">LAN Manager Samba API</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id321673">Parameters</a></span></dt><dt><span class="sect2"><a href="internals.html#id321779">Return value</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id321836">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="id321359"></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="id3 46942"></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="id321376"></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="id3 47046"></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="id321480"></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="id3 47056"></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="id321490"></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="id3 47066"></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="id347076"></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="id347087"></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="id321500"></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="id321510"></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="id321520"></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="id3 47098"></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="id3 47108"></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="id3 47119"></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="id3 47130"></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="id3 47140"></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="id3 47151"></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="id3 47161"></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="id3 47172"></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="id3 47182"></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="id3 47193"></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="id321532"></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="id321542"></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="id321553"></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="id321563"></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="id321574"></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="id321584"></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="id321595"></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="id321605"></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="id321616"></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="id321626"></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="id3 47204"></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="id3 47215"></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="id321637"></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="id321649"></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="id3 47239"></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="id321673"></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="id3 47345"></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="id321779"></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="id3 47402"></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="id321836"></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.