~ubuntu-branches/ubuntu/oneiric/samba/oneiric-security

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba-Developers-Guide/internals.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-07-21 17:53:23 UTC
  • mfrom: (0.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050721175323-m3oh6aoigywohfnq
Tags: 3.0.14a-6ubuntu1
Resynchronise with Debian, resolving merge conflicts (#12360)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�6.�Samba Internals</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="pt02.html" title="Part�II.�Samba Basics"><link rel="previous" href="debug.html" title="Chapter�5.�The samba DEBUG system"><link rel="next" href="CodingSuggestions.html" title="Chapter�7.�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�6.�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�6.�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><tt class="email">&lt;<a href="mailto:David.Chappell@mail.trincoll.edu">David.Chappell@mail.trincoll.edu</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">8 May 1996</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="internals.html#id2514252">Character Handling</a></span></dt><dt><span class="sect1"><a href="internals.html#id2514273">The new functions</a></span></dt><dt><span class="sect1"><a href="internals.html#id2514404">Macros in byteorder.h</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2514415">CVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514426">PVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514438">SCVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514449">SVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514462">IVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514473">SVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514485">IVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514497">SSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514509">SIVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514521">SSVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514532">SIVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514544">RSVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514556">RIVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514568">RSSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514580">RSIVAL(buf,pos,val)</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2514593">LAN Manager Samba API</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2514622">Parameters</a></span></dt><dt><span class="sect2"><a href="internals.html#id2514748">Return value</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2514819">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="id2514252"></a>Character Handling</h2></div></div><div></div></div><p>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�6.�Samba Internals</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.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�5.�The samba DEBUG system"><link rel="next" href="CodingSuggestions.html" title="Chapter�7.�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�6.�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�6.�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><tt class="email">&lt;<a href="mailto:David.Chappell@mail.trincoll.edu">David.Chappell@mail.trincoll.edu</a>&gt;</tt></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#id2534056">Character Handling</a></span></dt><dt><span class="sect1"><a href="internals.html#id2534078">The new functions</a></span></dt><dt><span class="sect1"><a href="internals.html#id2534208">Macros in byteorder.h</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2534220">CVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534231">PVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534242">SCVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534253">SVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534266">IVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534278">SVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534290">IVALS(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534302">SSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534313">SIVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534325">SSVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534337">SIVALS(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534349">RSVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534361">RIVAL(buf,pos)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534372">RSSVAL(buf,pos,val)</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534385">RSIVAL(buf,pos,val)</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2534398">LAN Manager Samba API</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#id2534426">Parameters</a></span></dt><dt><span class="sect2"><a href="internals.html#id2534552">Return value</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html#id2534624">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="id2534056"></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
4
4
</p><p>
8
8
telling if a particular char* is in dos codepage or unix
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="id2514273"></a>The new functions</h2></div></div><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="id2534078"></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>
14
14
        all char* strings inside Samba are "unix" strings. These are
70
70
        parameters is gone.
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="id2514404"></a>Macros in byteorder.h</h2></div></div><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="id2534208"></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="id2514415"></a>CVAL(buf,pos)</h3></div></div><div></div></div><p>
 
76
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2534220"></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="id2514426"></a>PVAL(buf,pos)</h3></div></div><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="id2514438"></a>SCVAL(buf,pos,val)</h3></div></div><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="id2514449"></a>SVAL(buf,pos)</h3></div></div><div></div></div><p>
 
78
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2534231"></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="id2534242"></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="id2534253"></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="id2514462"></a>IVAL(buf,pos)</h3></div></div><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="id2514473"></a>SVALS(buf,pos)</h3></div></div><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="id2514485"></a>IVALS(buf,pos)</h3></div></div><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="id2514497"></a>SSVAL(buf,pos,val)</h3></div></div><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="id2514509"></a>SIVAL(buf,pos,val)</h3></div></div><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="id2514521"></a>SSVALS(buf,pos,val)</h3></div></div><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="id2514532"></a>SIVALS(buf,pos,val)</h3></div></div><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="id2514544"></a>RSVAL(buf,pos)</h3></div></div><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="id2514556"></a>RIVAL(buf,pos)</h3></div></div><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="id2514568"></a>RSSVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the value of the unsigned short (16 bit) big-endian integer at 
 
82
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2534266"></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="id2534278"></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="id2534290"></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="id2534302"></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="id2534313"></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="id2534325"></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="id2534337"></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="id2534349"></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="id2534361"></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="id2534372"></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="id2514580"></a>RSIVAL(buf,pos,val)</h3></div></div><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="id2514593"></a>LAN Manager Samba API</h2></div></div><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="id2534385"></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="id2534398"></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
97
97
Manager 2.0 API documentation.  It should not be considered entirely
104
104
</p><p>
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="id2514622"></a>Parameters</h3></div></div><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="id2534426"></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>
110
110
        drcnt:   the number of bytes of data begin sent.
149
149
</p></li></ol></div><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="id2514748"></a>Return value</h3></div></div><div></div></div><p>
 
152
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2534552"></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>
155
155
An unsigned 16 bit integer which contains the API function's return code. 
180
180
The third parameter (which may be read as "SVAL(rparam,4)") has something to
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="id2514819"></a>Code character table</h2></div></div><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="id2534624"></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:
186
186
</p><div class="orderedlist"><ol type="1"><li><p>