SUMMARY: write a wrapper for telnet or xterm?

From: Chris Hoogendyk <choogend_at_library.umass.edu>
Date: Fri Mar 22 2002 - 17:41:00 EST
[original message at bottom]

[note: this resolves the pass-through printing issue I had posted previously]

Responses from only two people:
  Richard Mackerras, and
  Darren Dunham

While one gave me a run down of structural logic to approach the wrapper
design, both suggested checking into C-Kermit -- maybe it could do something.

Bingo!   <http://www.columbia.edu/kermit/ckermit.html>

I hadn't found it before, because Kermit on unix can't do terminal
emulation, and I had been searching for terminal emulators. However, it
can make telnet connections, and has an amazing array of capabilities
that are configurable and scriptable. Specifically, C-Kermit can act as
a "semitransparent pipe", passing characters you type to the remote
host, and sending the characters received to your screen (xterm). And,
in the Version 7 release, it included transparent or pass-through
printing (current release is 8).

I (1) downloaded a binary built for Solaris 8 on UltraSparc, put it in
/usr/local/bin/kermit and tested it. Then, from the version 7 update
notes, I (2) set my telnet application in Netscape to:

   xterm -geometry 80x25+340+325 -font 10x20 -fg black -bg white \
         -e /usr/local/bin/kermit -J %h %p

then I (3) set up a .kermrc file containing the line

   SET TERMINAL PRINT ON

based on information from the C-Kermit 8 Unix Hints and Tips document
and the C-Kermit 7.0 Case Study #09 document.

It works! HOWEVER, I still have a couple of glitches I'm trying to clear up.

First, it outputs some extra stuff at the top of the xterm window when
it starts up that I'd rather not bother users with (although I could
live with it if I can't figure out how to remove it): 

   DNS Lookup...  Trying 129.168.119.2...  Reverse DNS Lookup... (OK)
   library_catalog.umass.edu connected on port telnet

Second, and more importantly, the connection is inconsistent. I get a
connection the first time, and it seems to work fine, including
printing. Then I disconnect and try to reconnect and I get:

   DNS Lookup...  Trying 129.168.119.2...  Reverse DNS Lookup... (OK)
   library_catalog.umass.edu connected on port telnet
     Negotiations...............................
   *************************
   The Telnet server is not sending required responses.

   ?Telnet waiting for response to WILL KERMIT
   ?Telnet waiting for response to DO KERMIT

   You can continue to wait or you can cancel with Ctrl-C.
   In case the Telnet server never responds as required,
   you can try connecting to this host with TELNET /NOWAIT.
   Use SET HINTS OFF to suppress further hints.
   *************************
   ...............

If I break out and just go to a terminal window and telnet there, I can
get there. Furthermore, if there were a real problem with the library
catalog, the telephone would be ringing off the hook. So, it's not the
catalog server, it's my connection to it.

So, somehow it appears to be doing stuff that is unnecessary in this
situation, and it is getting in the way. I need to figure out some way
of turning off the extra stuff and having it just sit quietly in the
pipe and snag printing when it happens.

I'm wondering if the problem is that whatever the extra stuff is ends up
leaving something open to me on the server that obstructs subsequent
attempts to connect until it finally dies. Haven't been able to find any
such stuff, but then I don't know exactly what I would be looking for.

I guess I'm just getting started. I have a lot of documents to read
through so that I can define "stuff" and "something"  ;,)

But, if anyone has any clues or suggestions, it would certainly be
appreciated. I'm checking out now until Monday morning. Will assess the
situation then.

Thanks,
   


---------------

Chris Hoogendyk

-- 
   O__  ---- Network Specialist & Unix Systems Administrator
  c/ /'_ --- Library Information Systems & Technology Services
 (*) \(*) -- W.E.B. Du Bois Library
~~~~~~~~~~ - University of Massachusetts, Amherst

<choogend@library.umass.edu>

---------------


Chris Hoogendyk wrote:
> 
> I remember Kermit from the days of dial up connections.
> 
> I just checked out the C-Kermit pages at Columbia University. It does
> the kind of printing I need as of the 7.0 version (current version is
> 8.0). It appears to have become a fairly complex tool kit for making connections.
> 
> Just an off the top question -- why would I need to use Xterm with
> Kermit inside it? Won't Kermit open a telnet connection itself? My users
> are using Netscape and clicking on a link that takes them to the
> character based interface of our library catalog via telnet. I modified
> the global preferences in /etc so that the Netscape application telnet calls:
> 
>    xterm -geometry 80x25+340+325 -font 10x20 -fg black -bg white \
>          -e telnet %h %p
> 
> I can just as easily have it call C-Kermit or a script that opens
> C-Kermit inside xterm, but it needs to come up to them transparently so
> that they simply see the library catalog come up in a terminal window
> and when they exit the catalog the session goes away.
> 
> Meanwhile, I'm going to dump all the documentation on C-Kermit and start
> looking at it.
> 
> Thank you for that suggestion.
> 
> ---------------
> 
> Chris Hoogendyk
> 
> --
>    O__  ---- Network Specialist & Unix Systems Administrator
>   c/ /'_ --- Library Information Systems & Technology Services
>  (*) \(*) -- W.E.B. Du Bois Library
> ~~~~~~~~~~ - University of Massachusetts, Amherst
> 
> <choogend@library.umass.edu>
> 
> ---------------
> 
> Richard Mackerras wrote:
> >
> > Hi,
> >
> > I think your idea sounds good. I'm surprised you can't find a telnet client.
> > The DOS version of MSKERMIT is/was free and did support the feature, you
> > could look at C-Kermit (open XTERM, use kermit to telnet and do the
> > listening).
> > CRT is good and cheap but I don't know if it has the feature. Also SimpTerm
> > (SPTN3209.ZIP) is free, again I don't know if it supports the feature.
> >
> > What are the escape codes? I'll test SimpTerm for you.
> >
> > I hope I said something helpful there. Good luck.
> >
> > RM
> >
> > -----Original Message-----
> > From: Chris Hoogendyk [mailto:choogend@library.umass.edu]
> > Sent: Thursday, March 21, 2002 10:26 PM
> > To: sunmanagers@sunmanagers.org
> > Subject: write a wrapper for telnet or xterm?
> >
> > I have an idea how to solve a problem and thought I would solicit
> > feedback and ideas from the group.
> >
> > The problem:
> >
> >   --> pass-through printing from a remote application connected via
> > xterm <--
> >
> >       see --> http://www.anzio.com/support/whitepapers/printguide.htm
> >
> > since I haven't been able to find an inexpensive Unix terminal emulator
> > that supports pass-through printing, it occurred to me that it might be
> > possible to write a wrapper. the idea is that pass-through printing
> > sends the print output in the same stream as the terminal i/o,
> > delimiting it by an escape character sequence. a wrapper would sit on
> > the pipe between xterm and the remote client. it would watch for the
> > escape sequence. if it found it, it would strip out the print output and
> > route it to a file and then issue a print command. otherwise it would
> > simply pass input through between the remote application and xterm.
> >
> > I can modify the configuration of Netscape so that it will call the
> > wrapper instead of xterm when users click on a telnet link. The wrapper
> > would call xterm and mediate the connection to the remote host.
> >
> > does this seem like a workable solution?
> >
> > does it seem like a doable solution? (not too difficult or complex?)
> >
> > is it possible with Perl? or would it have to be C?
> >
> > anyone adept at this sort of thing want to urge me on with some how-to's
> > or code snippets or .....
> >
> > TIA
> >
> > ---------------
> >
> > Chris Hoogendyk
> >
> > --
> >    O__  ---- Network Specialist & Unix Systems Administrator
> >   c/ /'_ --- Library Information Systems & Technology Services
> >  (*) \(*) -- W.E.B. Du Bois Library
> > ~~~~~~~~~~ - University of Massachusetts, Amherst
> >
> > <choogend@library.umass.edu>
> >
> > ---------------
> > _______________________________________________
> > sunmanagers mailing list
> > sunmanagers@sunmanagers.org
> > http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Mar 22 16:43:05 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:37 EST