[Info-vax] Reverse telnet to a terminal emulator?

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Tue Jul 19 17:08:49 EDT 2011


In article <j04nl8$q39$1 at speranza.aioe.org>, Snowshoe <no at spam.please> writes:
>On 7/19/2011 7:47 AM, VAXman- @SendSpamHere.ORG wrote:
>> In article<j02l2e$2ha$1 at speranza.aioe.org>, Snowshoe<no at spam.please>  writes:
>>> Is there any such thing as VTxxx-compatible terminal server software
>>> that runs on a PC that, instead of actively connecting to a host via
>>> telnet, is "passive", it waits until something connects to it?  Once a
>>> host connects to it, it acts like a regular VTxxx terminal.  My idea is
>>
>> There are some here, myself included, would argue that there is no
>> PeeCee software that acts like a regulat VT terminal.
>
>In my case, it doesn't really matter.  There is little if any VTxxx 
>advanced features. Currently they are using Reflections on a PC 
>connected to a hardwired RS-232 link.
>
>
>>> for VMS to reverse-telnet to it. (TELNET>  CREATE_SESSION 10.9.8.7 23 100
>>> creates TNA100: on host at IP address 10.9.8.7 port 23) This is to
>>> replace a hardwired terminal that doesn't log in, but an application
>>> currently allocates it and uses it for part of its operator interface.
>>>
>>> If the answer is "no", an alternative is for someone to use ordinary
>>> terminal server SW to telnet into the VMS host and run a do-nothing
>>> program that goes into a permanent LEF state, and VMS finds its TNAx
>>> device and writes to it, but this is one step I'd rather not have the
>>> operators do.
>>
>> Sounds like a good job for a pseudo-terminal application.  You connect
>> your PeeCee with the not-ready-for-prime-time VT terminal emulation to
>> its PTD$READ side and your application talks to its PTD device.  It's
>> a very simple thing to program.
>
>I have done this in the past, sort of. (swiped 
>SYS$EXAMPLES:ALPHA_LOGGER.C and changed the non-pseudoterminal portion) 
>  The pseudoterminal part is actually strange code if you have to tamper 
>with it, but I didn't.

What's so strange about it?

1. Allocate process memory that will be used by the Pseudo-Terminal

   $EXPREG does this nicely but you could call LIB$GET_VM[_PAGE] or,
   perhaps, even the C malloc:

        $EXPREG_S       pagcnt  = #page_count,-
                        retadr  = PTD.IO_BUFFERS

2. Create the pseudo-terminal with the terminal characteristics you
   desire.

        PTD$CREATE_S    chan    = PTD.CHANNEL,-
                        charbuff= PTD.CHAR_BUFFER,-
                        buflen  = #buffer_length,-
                        inadr   = PTD.IO_BUFFERS


3. Queue a read...

	Allocate a buffer from the memory allocated for the pseudo-
        terminal in step 1.

        PTD$READ_S      efn     = #EFN$C_ENF,-
                        chan    = PTD.CHANNEL,-
                        astadr  = PTD.READ_AST,-
                        astprm  = buffer_address,-
                        readbuf = buffer_address+8,-
                        readbuf_len = #buffer_len-8

4.  The read AST...

	Gets the buffer (passed as the AST argument)
	Do what you need to with the data.
	Put the buffer back into the allocation pool.

	Allocate a buffer from the memory allocated for the pseudo-
        terminal in step 1.

        PTD$READ_S      efn     = #EFN$C_ENF,-
                        chan    = PTD.CHANNEL,-
                        astadr  = PTD.READ_AST,-
                        astprm  = buffer_address,-
                        readbuf = buffer_address+8,-
                        readbuf_len = #buffer_len-8


There you go, I just wrote the program for you.


-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

All your spirit rack abuses, come to haunt you back by day.
All your Byzantine excuses, given time, given you away.



More information about the Info-vax mailing list