SMBPD Version 0.94, a SMB printer server for DOS

SMBPD is a small program that turns an XT or AT running DOS into a
dedicated SMB printer server. You can send jobs to the printers from
any machine running WfWg or Samba. (W95 later, NT not tested, but
probably not yet.)  TCP/IP transport must be used. It can handle up to 3
parallel printer ports.  Serial printers can be handled by running
diverting LPTn to COMn and running the interrupt I/O driver TSRCOMM,
which is in LPTCOM.ZIP.

Even a small XT with only a floppy will do. If you have a 386 or better
then you should install Linux and run the Samba package.  If the system
is to run unattended you might even omit the keyboard and monitor.

Be warned, smbpd 0.94 is a preliminary piece of software. It can cause
your Windows apps to go into strange states, although it doesn't seem
to crash Windows apps any more, no more ill-formed messages are sent
by smbpd, I don't think.  There is a lot of work to be done.  If you
feel that you prefer something more solid, please wait for a later
release. But if you think smbpd could be of use to you and you don't
mind experimenting a bit and would like to help by sending in reports,
both positive and negative, maybe it is for you.

For smbpd installation instructions see smbpd.prn.

For client setup to work with smbpd, read on.

+ Printing from samba/smbclient works. A typical print command would
be:

	smbclient '\\machine\printer' -P -c 'print foo.txt'

where machine is the name assigned to the smbpd host in wattcp.cfg
and printer is one of lpt1, lpt2 or lpt3, or whatever you have set
PRINTERNAMES to in wattcp.cfg.  Remember machine must also be known
to the smbclient host either via DNS or /etc/hosts or whatever name
resolution method is used.  Get the latest release (>= 1.9.16) of samba
as old releases had a bug in smbclient with protocol negotiation.

+ Printing from WfWg 3.11 works. Here are the things you must do to be
able to print from WfWg.

1. You must have TCP/IP transport installed. Version 3.11b or later is
recommended. Smbpd doesn't work on Netbios transport.

2. From the Print Manager, connect a printer of the name \\machine\printer
where machine is the hostname set in wattcp.cfg and printer is one of
lpt1, lpt2 or lpt3, or whatever you have set the PRINTERNAMES to in
wattcp.cfg. You must have smbpd running for PM to successfully connect.

3. Smbpd now responds to a broadcast name query so you don't need to do
the step below. It is left in for reference. The name that smbpd
responds to is the hostname (minus the domain part) set in wattcp.cfg.
If you accidentally set two smbpds on the network to the same hostname,
I don't know what will happen. So don't do it. (A complicated protocol
described in RFC1002 is supposed to resolve conflicts like those.)

# Smbpd doesn't advertise the host's name so you need to add an entry
# to windows\lmhosts like this
# 
# 192.168.1.1	myprinter	#pre	#dom:mydom.com.au
# 
# The #pre is to load the address even before DNS is consulted. The
# #dom may not be needed but it provides a default domain in the
# absence of one.

You could also advertise using nmbd (from Samba package) or equivalent
somewhere on the network, probably on the master browser, so that
clients can find it. Apparently DNS also works.  I don't know exactly
how this works; please send me details if you get this to work.

4. If the printer is busy or offline for too long while printing,
WfWg will eventually time out on the reply to WritePrintFile and abort
the job.  Note this if you have a slow printer. Remember, smbpd doesn't
spool so the job will be transferred at the same average rate that the
printer prints.  So make sure your printer will not be busy for too long
or go offline once printing starts. Or increase the timeout parameter
(in Print Manager I think). The other thing you can do is decrease the
maximum SMB size with -z to reduce the amount of data transferred at
each request.

+ W95 almost works. Hang on.

+ Other clients not tested. Reports wanted please.

Before you report a problem, check TODO to see if it's already known.

List of files:

Artistic	Artistic License conditions
FILE_ID.DIZ	Description in zip
LOG		Change log
Makefile
README		This file
TODO		Uncompleted tasks
cmd.c		Handles SMB requests and replies
cmd.h
getopt.c	Handle command line argument parsing
lpt.c		Handles printer
lpt.h
lptcom.zip	TSRs for interrupt driven serial I/O using XON/XOFF
nameserv.c	Handles name queries.
nameserv.h
netio.c		Handles network I/O
netio.h
smbhdr.h	Definitions of SMB and related stuff
smbpd.c		Main
smbpd.exe	Executable
smbpd.h		Global definitions
smbpd.man	Man page
smbpd.prn	Preformatted version of above
trans.c		Handles transactions
trans.h
tcp.h		Copy of one from Wattcp library
util.c		Utility routines
util.h
wattcp.cfg	Sample config file for Wattcp
wattcpcp.lib	Compact model Wattcp library

Resources:

Here are some FTP sites for auxiliary and related software.  The sites
named here are the normal ones and it's best to ask archie for the
nearest archive to you.

Samba package:
	ftp://nimbus.anu.edu.au/pub/tridge/samba/

A cut down Linux kernel which might be just the thing to run Samba on a 386:
	http://rsphy1.anu.edu.au/~gpg109/

Packet drivers
	ftp://ftp.simtel.net/pub/simtelnet/msdos/pktdrvr/
	Current version of the packet drivers is 11.

PDCLKSET
	ftp://ftp.simtel.net/pub/simtelnet/msdos/pktdrvr/pdtstNNN.zip
	A small program to set the PC clock from a server running timed(udp).

WATTCP library sources
	ftp://ftp-ns.rutgers.edu/pub/pc/wattcp/

comp.protocols.tcp-ip.ibmpc FAQ
	ftp://ftp.netcom.com/pub/mailcom/IBMTCP/ibmtcp.zip
	Answers a lot of questions about TCP-IP on PCs.

RFC1001 and RFC1002
	Describe SMB protocol on top of TCP/IP.

Microsoft Networks SMB File Sharing Protocol, V6.0p, Microsoft Corp.
	Badly organised and incomplete, but there is little else available

Background:

(To be written when I have some time.)

Acknowledgements:

SMBPD uses the excellent WATTCP package by Erick Engelke of the U of
Waterloo. I stole the skeleton of SMBPD from COMD. Russ Nelson of Crynwr
Software has put a lot of work into packet drivers for many NICs.
Andrew Tridgell wrote Samba, from which many valuable clues and
even some utility routines were obtained.

SMBPD is free software. The software is provided as-is and there is
NO SUPPORT. I will however endeavour to help if you can describe your
problem in sufficient detail. Please remember that I have only a vanilla
system and I cannot test exotic configurations.

If you find SMBPD useful, send me a nice note by email telling me how
you use it. If you really like it, send me a postcard of your country.

Disclaimer: SMBPD is in no way related to my employment and was written
in my spare time.

Here are my contact addresses. Email is most preferred.

	ken@syd.dit.csiro.au

	Ken Yap
	CSIRO Division of Information Technology
	Locked Bag 17
	North Ryde 2113
	Australia
	+61 2 3253100

Ken Yap
December 1996
