Windows Sockets LPD Client Application - PrintSRV and PassPRN Copyright (C) 1995-1996 by Agustin Lopez Bueno & Centro de Informatica - Universitat de Valencia. All rights reserved. (PLEASE REVIEW THE ENTIRE CONTENTS OF THIS FILE!!!!) THE INFORMATION AND CODE PROVIDED IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL WE BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ********************************************************************** * This program executable, help file and related text files may be * * used without fee by individuals for non-commercial home use, and * * by students, faculty and staff of academic institutions. * * * * Non-commercial home use: Free * * Academic use: Free * * All other uses: Contact Centro de Informatica - Universitat de * * Valencia. * * * * Archive sites: This program may be included on Government, * * academic and non-commercial Internet archive sites and on CD-ROM * * collections distributed by such sites, provided any charge is * * solely to recover the cost of distribution. Any such * * distribution must contain the complete program, including this * * file. Non-commercial Internet archive sites must not be in the * * business of making a profit from selling hardware, software, * * information or services. (SimTel and mirrors authorized) * * * * For distribution rights and for all other uses, including * * all corporate use, please contact Centro de Informática - * * Universitat de Valencia at or * * the author at for license information. * * Both can also be contacted via mail at Centro de Informatica, * * Universitat de Valencia, Dr. Moliner 50, 46100-Burjasot, Valencia * * SPAIN. * * ********************************************************************** DESCRIPTION: ============ This application is a standard line printer daemon protocol (LPD) SERVER application for Windows Sockets. It listen at the TCP port 515 (configurable) for incoming print request that follows the lpd protocol (RFC 1179), and sent them to the specified queue. The enqueuing is done by calling a user-selectable (by queue) program, that receives as arguments the file to print and some configurable options (for example, a Windows queue name). A simple program is provided (pssprn) that enqueues the file to the specified windows queue. Also, an example queue definition is provided that uses the windows notepad as "enqueuing" program: that displays the file on the screen. The provided enqueing program passprn can enqueue to ANY windows printer queue, including queues that print to local files and network printers. No processing of any type is done on the recived file, before sending it to the printer. Passprn doesn't work in windows NT (blame the API function SpoolFile()). Security is enforced at host level: only hosts listed in the host.lpd file are allowed to connect. If the file doesn't exists, all hosts are allowed. The present version doesn't support the protocol "remove jobs" command. The "queue state" command always returns "No entries" (except for queue "all"). The control file (printing) options are stored (optionally) in a ".ctl" file that the enqueing program can examine to do the appropiate actions (passprn ignores them). This program is known to work with: . Windows3.11 with Microsft TCP/IP. . Windows3.1 & Windows3.11 with P.Tattam WinSock. . Windows95. . Windows NT, excepted passprn. REQUIREMENTS: ============= PrintSRV requires you to have a properly installed WINSOCK.DLL and requires Windows 3.1 or later. If you don't have a WINSOCK.DLL, I'd suggest getting the free one from Microsoft or the shareware Trumpet Winsock from ftp.trumpet.com.au or buying a vendor supported one (for example from FTP Software, Inc). Windows NT and Windows 95 come with a WINSOCK.DLL. If you use a different vendors stack on these platforms you will need to replace the WSOCK32.DLL that comes with the OS. Passprn doesn't work in windows NT, because the API function SpoolFile() doesn't work. Please contact us, if anybody knows how to made this to work in NT. PAKING LIST =========== Files included in this package are: printsrv.txt This file. printsrv.exe The LPD daemon. printsrv.ini The definitions/preferences file for the LPD daemon. host.lpd A SAMPLE security file passprn.exe The "basic" enqueuing program. passprn.ini The definitions/preferences file for passprn.exe. 1179.rfc RFC1179. INSTALLATION: ============= YOU MUST HAVE A PROPERLY INSTALLED WINSOCK.DLL FOR THIS APPLICATION TO WORK. REFER TO YOUR WINSOCK.DLL DOCUMENTATION FOR SETUP!! 1. Create a directory for this program and expand and copy there all the files of the package. 2. Create or edit the "hosts.lpd" file. This file is a list, one per line, of hosts (domain names of them) allowed to use your printers through PrintSRV. Use any ASCII text editor, such notepad. 3. Create an ICON in any Program Manager group. a. Use the File Manager and drag the program into a Program Manager group. b. Use [F]ile [N]ew in the Program Manager. 4. Launch the program by clicking two times in the ICON. It must show a window with your computer (TCP/IP) name, and your Winsock version. 5. Push the "Setup" button. Choose the temp directory where received, control, & log files will be stored. Select "Use log file" if you want a log of all PrintSRV activities be recorded in the file "printsrv.log". Don't change the port number if you are not really sure you need to do that. Check the "Write control file" only if your enqueuing program(s) uses (and deletes) them; passprn don't do that. 6. Create the needed queues (maximum allowed 20), by clicking and filling the fields of a queue definition (1 line/queue): . Queue name. Arbitrary. Better if less than 10 characters long. . Launcher program. Usually passprn.exe. Clicking two times in this field pops-up a file-selection window. . Driver & Port (corresponding to a windows printer queue). Clicking two times in one of these fields pops-up a driver/port selection menu. . Options for the enqueuing program. None for passprn. 7. Click the OK button & iconize (if desired) the PrintSRV window. You are ready to receive remote printing jobs. 7. If you want PrintSRV to start every time you launch windows, put the icon (or a copy of it) in the "Init" group of the program manager. In this case, you probably will also want to select the "start iconized" option of the Icon definition menu. OTHER TIPS ========== The "restart" button of printsrv aborts all connections and reinitializes the server. The "Close" button aborts all connections and terminates the server. When a "queue status" (lpq) request is received for the queue "all", a list of all configured queues is returned. For network installation, put the "printsrv.ini" file where the program can found it, and where the file will be writable. Suggestions are: the windows directory, the windows/system directory, the working directory. Obviously, also the temp directory must be writable and in the local disk. The setup can be locked (the "OK" button deactivated) if the "blockedsetup" option in the "printsrv.ini" file is set to "1". This is useful if you want to avoid "accidental" modification of the PrintSRV configuration. Passprn also prints a log of its activities, in the file specified in the passprn.ini file. If you use a (non provided) enqueuing program that needs the control files, you will need to check the "Write Configuration files" from the setup menu. The enqueuing program will be responsible of erasing these files after use. Note that the option is valid for ALL queues, so if you have others queues that ignore the config files, you will need to remove periodically these config files; else they will be stored indefinitely in the temp directory (sorry: this still is in the "TODO" list). If you like this program, let other people know about it! Post your comments in comp.protocol.tcp-ip.ibmpc, alt.winsock and in the windows groups on usenet and places like compuserve. Let people know about it! VALID COMMAND LINE OPTIONS & ARGUMENTS: ======================================= Printsrv: None. Passprn : Any enqueing program: {driver} {port} {options} Note that "{ }" arguments are optional arguments. The meaning of them only depends of the specific enqueuing program used. WHERE TO GET IT =============== ftp://ftp.uv.es/pub/windows/network/prsrv10.zip SUPPORT ======= ALL beginner support is provided through e-mail to and to . ALL bug reports and suggestions for improvement should be sent to . ALL distribution, commercial purchase requests need to be sent to KNOWN PROBLEMS ============== Passprn doesn't work in windows NT, because the API function SpoolFile() doesn't work. Please contact us if anybody knows how to made this to work in NT. Author ====== Agustin Lopez Bueno Internet: Centro de Informatica Universitat de Valencia Dr. Moliner 50, 46100-Burjasot, Valencia, SPAIN.