_________________________________
 NetBlazer Printer Spooler Driver

 This software package allows a printer attached to a NetBlazer
serial port to be used by the BSD line printer spooler.

 Several design details of this implementation are discussed here.

_________________
 Process Overview

 Two programs are used in this implementation. One (daemon) opens
a connection to the NetBlazer and remains active in order to work
around known bugs in some network software. The program
actually invoked by the BSD lpd merely connects to the daemon
using a BSD Unix Domain Socket. For every printer attached to a
NetBlazer serial port, one daemon process is needed. The lpd
spawned program is a link to the real client of the daemon.
This link is used as a cheap way of providing the client
with the hostname and port used on the NetBlazer.

_____________
 Installation

 The following installation guide is intended for experienced
unix system administrators. No attempt is made to cover any of
the possible printers that might be used with this software.

_________________
 NetBlazer Issues

 Set up a raw server for the line the printer is attached to.
The raw server capability of the NetBlazer also needs to be
enabled. In this example we will assume NetBlazer host name
of nblpt, with the printer attached to line10. On the
NetBlazer, type:

callin line10 off
auto line10 off
flow line10 cts
line speed line10 9600
reset line10
characteristics line10 raw
server start raw

 You should now be able to telnet to the NetBlazer's IP address,
using port number 7000 (the "raw" connection) plus the number
of the line the printer is attached to. For our example, this
is line10, thus our telnet command is "telnet nblpt 7010."

Note that your printer may require xon/xoff (software) rather than
cts/rts (hardware) flow control, and a different baud rate.

 Save your changes. The NetBlazer is now set up.

________________________
 BSD Line Printer Issues

 Shown is an example /etc/printcap entry.

nblpt10:\
        :lp=/dev/nblpt10:\
        :sf:\
        :tr=The NetBlazer Printer Hack daemon bids you goodnight.\r\n:\
        :of=/usr/local/bin/nblpt10:\
        :sd=/usr/spool/nblp10:\
        :lf=/usr/adm/lpd-errs:

The two key points are that the "of" specifies the program that
actually sends the data to the NetBlazer, and that this program
is merely a link, where the link name is the host name of the
NetBlazer, with the line number of the printer line appended.
The NetBlazer spooler software uses the link to decide what
host and port to connect to.

The file /dev/nblpt10 should be a device with the same characteristics
as /dev/null. For sunos, examine the file MAKEDEV and extract the
command used to create /dev/null, for example "mknod null c 3 2."
Duplicate this entry for each spooler you wish your workstation
to support. In our example, "mknod nblpt10 c 3 2."

Be sure to create the spooling directories as well.

____________________________
 Program Installation Issues

 Build the binaries from the provided source. Install the nblp
program in the /usr/local/bin directory. Add a link to this
file so that the link is the same name as the host entry in
your hosts database, with the line number that the printer is
on appended. In this example it is hostname nblpt, with the
printer on line10, thus the link should be "nblpt10."

The ls -lg should show a similar output:

-rwxrwxr-x  1 bjork  wheel 32768 Feb  7 17:11 /usr/local/bin/nblp*
lrwxrwxrwx  1 wraith staff     4 Feb  6 20:30 /usr/local/bin/nblpt10 -> nblp

Install the nblpd daemon in a suitable directory. Once your
installation is debugged, you may wish to add lines to your
rc.local file to start the printer daemons at boot time.

______________________________________
 Starting the NetBlazer Printer Daemon

The daemon is invoked with one argument. This argument is the
hostname of the remote printer, with the line number of the
line the printer is attached to appended. The daemon builds a unix
domain socket using this name for interprocess communication
with the nblp client. As supplied, the /tmp directory is used
for this file. In our example, with host name nblpt, and
a printer attached to line 10, our command would be:

./nblpd nblpt10

This will plant the new daemon in the active process list.
Check for the unix domain socket with the following command:

ls -lg /tmp/.*??
srwxrwxrwx  1 wraith   wheel           0 Feb  7 19:27 /tmp/.nblpt10=

As a further check, use the file command:

file /tmp/.nblpt10
/tmp/.nblpt10:    socket

Your printer should now be ready for testing.

____________________
 Testing the Printer

 Insure that the line printer spooler subsystem is operating.
To start, you can use "lpc restart all," and if things are
well, the name of our example printer, nblpt10, should appear.

The following is an example of a printer spooler command:

lpr -Pnblpt10 /etc/motd

This should cause a copy of the message of the day file to be
sent to our newly installed network printer.

_________
 Appendix

The author can be reached at:

Steven Bjork
Telebit Corporation
1315 Chesapeake Terrace
Sunnyvale CA 94084
+1-408-745-3249
bjork@telebit.com.
