Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/docs/htmldocs/Samba3-Developers-Guide/devprinting.html

    r368 r411  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 15. Samba Printing Internals</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt04.html" title="Part IV. Debugging and tracing"><link rel="prev" href="tracing.html" title="Chapter 14. Tracing samba system calls"><link rel="next" href="pt05.html" title="Part V. Appendices"></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 15. Samba Printing Internals</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="tracing.html">Prev</a> </td><th width="60%" align="center">Part IV. Debugging and tracing</th><td width="20%" align="right"> <a accesskey="n" href="pt05.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 15. Samba Printing Internals"><div class="titlepage"><div><div><h2 class="title"><a name="devprinting"></a>Chapter 15. Samba Printing Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="surname">Carter</span></h3></div></div><div><p class="pubdate">October 2002</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="devprinting.html#id2567455">Abstract</a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2567467">
     1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 15. Samba Printing Internals</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt04.html" title="Part IV. Debugging and tracing"><link rel="prev" href="tracing.html" title="Chapter 14. Tracing samba system calls"><link rel="next" href="pt05.html" title="Part V. Appendices"></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 15. Samba Printing Internals</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="tracing.html">Prev</a> </td><th width="60%" align="center">Part IV. Debugging and tracing</th><td width="20%" align="right"> <a accesskey="n" href="pt05.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="devprinting"></a>Chapter 15. Samba Printing Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="surname">Carter</span></h3></div></div><div><p class="pubdate">October 2002</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="devprinting.html#id2561382">Abstract</a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2561395">
    22Printing Interface to Various Back ends
    3 </a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2567544">
     3</a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2561471">
    44Print Queue TDB's
    5 </a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2567717">
     5</a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2561645">
    66ChangeID and Client Caching of Printer Information
    7 </a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2567728">
     7</a></span></dt><dt><span class="sect1"><a href="devprinting.html#id2561655">
    88Windows NT/2K Printer Change Notify
    9 </a></span></dt></dl></div><div class="sect1" title="Abstract"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2567455"></a>Abstract</h2></div></div></div><p>
     9</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2561382"></a>Abstract</h2></div></div></div><p>
    1010The purpose of this document is to provide some insight into
    1111Samba's printing functionality and also to describe the semantics
    1212of certain features of Windows client printing.
    13 </p></div><div class="sect1" title="Printing Interface to Various Back ends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2567467"></a>
     13</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2561395"></a>
    1414Printing Interface to Various Back ends
    1515</h2></div></div></div><p>
     
    1717function prototypes are defined in the <code class="varname">printif</code> structure declared
    1818in <code class="filename">printing.h</code>.
    19 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>retrieve the contents of a print queue</p></li><li class="listitem"><p>pause the print queue</p></li><li class="listitem"><p>resume a paused print queue</p></li><li class="listitem"><p>delete a job from the queue</p></li><li class="listitem"><p>pause a job in the print queue</p></li><li class="listitem"><p>result a paused print job in the queue</p></li><li class="listitem"><p>submit a job to the print queue</p></li></ul></div><p>
     19</p><div class="itemizedlist"><ul type="disc"><li><p>retrieve the contents of a print queue</p></li><li><p>pause the print queue</p></li><li><p>resume a paused print queue</p></li><li><p>delete a job from the queue</p></li><li><p>pause a job in the print queue</p></li><li><p>result a paused print job in the queue</p></li><li><p>submit a job to the print queue</p></li></ul></div><p>
    2020Currently there are only two printing back end implementations
    2121defined.
    22 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>a generic set of functions for working with standard UNIX
    23         printing subsystems</p></li><li class="listitem"><p>a set of CUPS specific functions (this is only enabled if
    24         the CUPS libraries were located at compile time).</p></li></ul></div></div><div class="sect1" title="Print Queue TDB's"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2567544"></a>
     22</p><div class="itemizedlist"><ul type="disc"><li><p>a generic set of functions for working with standard UNIX
     23        printing subsystems</p></li><li><p>a set of CUPS specific functions (this is only enabled if
     24        the CUPS libraries were located at compile time).</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2561471"></a>
    2525Print Queue TDB's
    2626</h2></div></div></div><p>
     
    7878When updating a print queue, smbd will perform the following
    7979steps ( refer to <code class="filename">print.c:print_queue_update()</code> ):
    80 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Check to see if another smbd is currently in
     80</p><div class="orderedlist"><ol type="1"><li><p>Check to see if another smbd is currently in
    8181        the process of updating the queue contents by checking the pid
    8282        stored in <code class="constant">LOCK/<em class="replaceable"><code>printer_name</code></em></code>. 
    83         If so, then do not update the TDB.</p></li><li class="listitem"><p>Lock the mutex entry in the TDB and store our own pid.
    84         Check that this succeeded, else fail.</p></li><li class="listitem"><p>Store the updated time stamp for the new cache
    85         listing</p></li><li class="listitem"><p>Retrieve the queue listing via "lpq command"</p></li><li class="listitem"><pre class="programlisting">
     83        If so, then do not update the TDB.</p></li><li><p>Lock the mutex entry in the TDB and store our own pid.
     84        Check that this succeeded, else fail.</p></li><li><p>Store the updated time stamp for the new cache
     85        listing</p></li><li><p>Retrieve the queue listing via "lpq command"</p></li><li><pre class="programlisting">
    8686        foreach job in the queue
    8787        {
     
    9595                                update the job status only
    9696                }
    97         }</pre></li><li class="listitem"><p>Delete any jobs in the TDB that are not
    98         in the in the lpq listing</p></li><li class="listitem"><p>Store the print queue status in the TDB</p></li><li class="listitem"><p>update the cache time stamp again</p></li></ol></div><p>
     97        }</pre></li><li><p>Delete any jobs in the TDB that are not
     98        in the in the lpq listing</p></li><li><p>Store the print queue status in the TDB</p></li><li><p>update the cache time stamp again</p></li></ol></div><p>
    9999Note that it is the contents of this TDB that is returned to Windows
    100100clients and not the actual listing from the "lpq command".
     
    111111queue TDB.  Otherwise, the Device Mode is obtained from the printer
    112112object when the client issues a GetJob(level == 2) request.
    113 </p></div><div class="sect1" title="ChangeID and Client Caching of Printer Information"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2567717"></a>
     113</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2561645"></a>
    114114ChangeID and Client Caching of Printer Information
    115115</h2></div></div></div><p>
    116116[To be filled in later]
    117 </p></div><div class="sect1" title="Windows NT/2K Printer Change Notify"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2567728"></a>
     117</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2561655"></a>
    118118Windows NT/2K Printer Change Notify
    119119</h2></div></div></div><p>
     
    128128</p><p>
    129129The basic set of RPC's used to implement change notification are
    130 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>RemoteFindFirstPrinterChangeNotifyEx ( RFFPCN )</p></li><li class="listitem"><p>RemoteFindNextPrinterChangeNotifyEx ( RFNPCN )</p></li><li class="listitem"><p>FindClosePrinterChangeNotify( FCPCN )</p></li><li class="listitem"><p>ReplyOpenPrinter</p></li><li class="listitem"><p>ReplyClosePrinter</p></li><li class="listitem"><p>RouteRefreshPrinterChangeNotify ( RRPCN )</p></li></ul></div><p>
     130</p><div class="itemizedlist"><ul type="disc"><li><p>RemoteFindFirstPrinterChangeNotifyEx ( RFFPCN )</p></li><li><p>RemoteFindNextPrinterChangeNotifyEx ( RFNPCN )</p></li><li><p>FindClosePrinterChangeNotify( FCPCN )</p></li><li><p>ReplyOpenPrinter</p></li><li><p>ReplyClosePrinter</p></li><li><p>RouteRefreshPrinterChangeNotify ( RRPCN )</p></li></ul></div><p>
    131131One additional RPC is available to a server, but is never used by the
    132132Windows spooler service:
    133 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>RouteReplyPrinter()</p></li></ul></div><p>
     133</p><div class="itemizedlist"><ul type="disc"><li><p>RouteReplyPrinter()</p></li></ul></div><p>
    134134The opnum for all of these RPC's are defined in include/rpc_spoolss.h
    135135</p><p>
     
    173173The current list of notification events supported by Samba can be
    174174found by examining the internal tables in srv_spoolss_nt.c
    175 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>printer_notify_table[]</p></li><li class="listitem"><p>job_notify_table[]</p></li></ul></div><p>
     175</p><div class="itemizedlist"><ul type="disc"><li><p>printer_notify_table[]</p></li><li><p>job_notify_table[]</p></li></ul></div><p>
    176176When an event occurs that could be monitored, smbd sends a message
    177177to itself about the change.  The list of events to be transmitted
     
    193193The actual change notification is performed using the RRPCN request
    194194RPC.  This packet contains
    195 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>the printer handle registered with the
    196 client's spooler on which the change occurred</p></li><li class="listitem"><p>The change_low value which was sent as part
    197 of the last RFNPCN request from the client</p></li><li class="listitem"><p>The SPOOL_NOTIFY_INFO container with the event
     195</p><div class="itemizedlist"><ul type="disc"><li><p>the printer handle registered with the
     196client's spooler on which the change occurred</p></li><li><p>The change_low value which was sent as part
     197of the last RFNPCN request from the client</p></li><li><p>The SPOOL_NOTIFY_INFO container with the event
    198198information</p></li></ul></div><p>
    199199A <code class="varname">SPOOL_NOTIFY_INFO</code> contains:
    200 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>the version and flags field are predefined
    201 and should not be changed</p></li><li class="listitem"><p>The count field is the number of entries
     200</p><div class="itemizedlist"><ul type="disc"><li><p>the version and flags field are predefined
     201and should not be changed</p></li><li><p>The count field is the number of entries
    202202in the SPOOL_NOTIFY_INFO_DATA array</p></li></ul></div><p>
    203203The <code class="varname">SPOOL_NOTIFY_INFO_DATA</code> entries contain:
    204 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The type defines whether or not this event
    205 is for a printer or a print job</p></li><li class="listitem"><p>The field is the flag identifying the event</p></li><li class="listitem"><p>the notify_data union contains the new valuie of the
    206 attribute</p></li><li class="listitem"><p>The enc_type defines the size of the structure for marshalling
    207 and unmarshalling</p></li><li class="listitem"><p>(a) the id must be 0 for a printer event on a printer handle.
     204</p><div class="itemizedlist"><ul type="disc"><li><p>The type defines whether or not this event
     205is for a printer or a print job</p></li><li><p>The field is the flag identifying the event</p></li><li><p>the notify_data union contains the new valuie of the
     206attribute</p></li><li><p>The enc_type defines the size of the structure for marshalling
     207and unmarshalling</p></li><li><p>(a) the id must be 0 for a printer event on a printer handle.
    208208(b) the id must be the job id for an event on a printer job
    209209(c) the id must be the matching number of the printer index used
     
    211211handle for notification.  Samba currently uses the snum of
    212212the printer for this which can break if the list of services
    213 has been modified since the notification handle was registered.</p></li><li class="listitem"><p>The size is either (a) the string length in UNICODE for strings,
     213has been modified since the notification handle was registered.</p></li><li><p>The size is either (a) the string length in UNICODE for strings,
    214214(b) the size in bytes of the security descriptor, or (c) 0 for
    215215data values.</p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tracing.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pt05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 14. Tracing samba system calls </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part V. Appendices</td></tr></table></div></body></html>
Note: See TracChangeset for help on using the changeset viewer.