Re: transparent printer with pc



Steve M. Fabac, Jr. wrote:
Ygnacio Moreno wrote:

Steve M. Fabac, Jr. wrote:
<< Lot of stuff clipped to save bandwith>>


From one of your replies to Bob Rasmussen you indicated that your application is
printing to the transparent print device created by the Equinox serial system.
Somewhere in your application configuration file(s), you must have defined this
for each serial tty. Your problem is how to replace this with IP. We can't offer
specific help without knowing how you can change the configuration files. Please
post the current configuration file with enough information so that we can
make useful suggestions.

IPLINPUT device configuration file:

CNF 1,14,1,18,/,[,],0
PTN 1,28000
DEV D0,1,,,,,,data
DEV D2,1,,,,,,prog
DEV D3,1,,,,,,utils
DEV D4,1,,,,,,idx
DEV D5,1,,,,,,tmdat
DEV D6,1,,,,,,smc
DEV D9,1,,,,,,/usr2/AA
DEV T0,7,,,,,,tty
DEV LP,4,,,,,,lp0
DEV P1,4,,,,,,lp16
DEV P2,4,,,,,,lp15
DEV P3,4,,,,,,lp14
DEV P4,4,,,,,,lp09
DEV P9,4,,,,,,null
IPL 1,2,T0,OSSDT
END

If you never worked with SMC Business Basic (Later Thoroughbred) you
probably would not understand it. DEV Dx are available directories.
T0 is your terminal DEV LP and Px are printers, which basic interprets
as devices in the /dev directory. From inside the app, they are known as
printer #1 (LP), 2 (P1), 3 (P2) and so on. In this case Printer # 10
(P9) is set to throw away output.
A utility inside the App allows the user to select the printer or have
it preset for each TERM (tty).
Being a very old version of Basic, it doesn't work with the Unix Spooler
  (it used to).


The last time I had a client on Thoroughbred was 1996.

That probably was about the last one I installed. Works so good it's impossible to get them to switch.


From your IPLINPUT above,
I don't see any references to the Equinox transparent print device for the users' serial connection.
 I do see the entry for "DEV T0,7,,,,,,tty" that

The Tx (T0,T1, etc) gets assigned in the starting shell according to the ttyxx. It can be assigned any number.


leads me to believe that if the user selects T0 for output, your app will generate the transparent print-on...data..print-off characters to send the
output to the terminal's printer port. If (and a big IF)

You said it. Have been testing that and it errors out. Matter of fact, I have it setup that when they select printer #0, it prints to the screen, but have not been able to insert those printer controls in the stream. I'll keep on trying.


that is true, then
Anzio emulating your existing terminals (Wyse 60?) will likely work.

Also, the lp09, lp14, lp15, and lp16 entries are non OS /dev devices.

The lp13,lp14, etc are linked to tty1a13, tty1a14, etc. In the case of transparent devices, it would be tty1a15lp, etc. Done this to keep it the way it was, that's all.


Likely they refer to (or have the same major, minor device nodes) as
the Equinox Transparent print device? Or do they point to local printers
connected to the Equinox serial ports?


How is the printer attached to the remote terminal identified? In another post,
you identify two remote terminals and printers. What entry in IPLINPUT points to
those two printers?

The iplinput file you see here is not the same one at the server in question.
This was shown for demonstration only. The real one woud be


DEV P5,,,,,,tty1a3lp

and would be attached to tty1A3.

Your problem is basically: reconfigure your application to identify users
connected via TCP/IP (ttypxx) instead of by serial connection.  Then
configure your application and /dev entries to transport the print job
back to the originating IP of the logged in user.


That sounds right.


Hopefully, everyone is using unique login identities. If all the remote
users use the same login name ("ticket?") then it gets harder.


They all have their own login id.


You must abandon telnet and use ssh if you are going over the internet.


No problem there.


SSH gives you the ability to "forward" IP ports from your UNIX server
to selected ports on the remote windows machine.

I have set up  "poor man's" remote printing using netcat to print to a
forwarded port (unique for each logged in user) and nc for windows (the
original netcat from hobbit) to receive the job at the windows machine and
dump it to LPT: on Windows 98 (haven't got it to work on XP yet, so 2000
will likely not work as well). Also USB printers require additional
configuration where LPT: is monitored and sent to a network printer.


We (I) have a problem there; using 2000 and/or XP.


My login account .profile on all my client's machines define port 2022
as the reverse print port for me. I set up a spooled printer named homeptr
that uses netcat to send the job to localhost:port 2022 and configure my SSH
client to forward unix:port 2022 to windows localhost:2022 and have nc
waiting to copy from windows localhost:2022 to LPT:.  That way, when I need
to print anything from my client's system to my local HP LaserJet II on LPT1,
I send it to lp -dhomeptr and it gets printed locally.


That is cool. But like I mentioned before, using the Unix spooler is not possible in this case. I could try to make it work with a pipe and a background program reading it and sending the output to lpd. I'll play with it.


Note that over a LAN connection this does not work well. But dsl to dsl connections
work without loosing data.

Netcat /etc/printers entry for homeptr:
homeptr:localhost:SSH_PRINTER:Remote printer for SSH USER

.profile entry for homeptr:
[ -n "$SSH_CLIENT" ] && {
echo "2022" > .ssh_printer
chmod 644 .ssh_printer
TZ=CST6CDT; export TZ
}

[ -f .ssh_printer ] && {
       SSH_PRINTER=`cat .ssh_printer`
        export SSH_PRINTER
}

homeptr modifications to netcat printer model:
# Look for HOST and Port address
PRTSETUP=`grep "^$printer:" /etc/printers`
if [ $? = 0 ]
then
PRTHOST=`echo $PRTSETUP|awk -F: '{ print $2 }'`
PRTPORT=`echo $PRTSETUP|awk -F: '{ print $3 }'`
else
exit 1
fi

if [ "$PRTPORT" = "SSH_PRINTER" ]
then
       # user home directory  = sixth field of /etc/passwd
       uhome=`sed -n "s/^$name:.*:.*:.*:.*:\(.*\):.*$/\1/p" /etc/passwd`
       PRTPORT=`cat $uhome/.ssh_printer`
fi



So that printer host and printer port is configured properly for the
output section of netcat printer script:

# send the file(s) to the standard out $copies times
while   [ "$copies" -gt 0 ]

do
       for file
       do
               0<${file} eval ${FILTER}
               echo "\f\c"
       done
       copies=`expr $copies - 1`
done ) | /usr/local/bin/netcat -h $PRTHOST -p $PRTPORT
sleep 1
exit 0


Net.bat on Windows 98 (started when TeraTermPro with SSH extensions is started:

echo off
:begin
if exist exit.txt goto quit
nc -l -n -p 2022 | cat > lpt1:
goto begin
:quit
exit






Hope I made it clear.


You certainly did. I'll see what I can do about installing netcat and nc and see if it works with 2000 and/or XP.


--
Ygnacio Moreno.

Please remove TheObvious from email address to reply.



--

                                     Steve Fabac
                                      S.M. Fabac & Associates
                                       816/765-1670

I really appreciate your help.

--
Ygnacio Moreno.

Please remove TheObvious from email address to reply.



--

                                      Steve Fabac
                                       S.M. Fabac & Associates
                                        816/765-1670


--
Ygnacio Moreno.

Remove 'TheObvious' from email to respond.
.



Relevant Pages

  • Re: transparent printer with pc
    ... forwarded port and nc for windows to receive the job at the windows machine and dump it to LPT: on Windows 98. ... echo "2022"> .ssh_printer chmod 644 .ssh_printer ... S.M. Fabac & Associates ...
    (comp.unix.sco.misc)
  • error 633 on win Xp home edition
    ... It seems that the modem won't communicate with the port. ... Windows says also that there ... are NO conflicts in my configuration. ...
    (microsoft.public.windowsxp.configuration_manage)
  • Spurious completions during NCQ
    ... support DPO or FUA ... ACPI: PM-Timer IO Port: 0x408 ... Using ACPI for SMP configuration information ...
    (Linux-Kernel)
  • Re: keeping ports open
    ... If a port is open, it means that 1) a software or service is running on your ... and 2) you're not using a firewall or your firewall isn't ... Use firewall software and hardware and antivirus software that is ... Follow the instructions for hardening Windows and IIS at ...
    (microsoft.public.security)
  • [Full-Disclosure] ron1n phone home, episode 4
    ... Hacking from Windows 3.x, 95 and NT ... Use secret Windows 95 DOS commands to track down and port surf computers ... Download hacker tools such as port scanners and password crackers designed ... Now you have the option of eight TCP/IP utilities to play with: telnet, ...
    (Full-Disclosure)