
				VIOROUTE
				--------
		          2002-2003 (c) nickk

Status:
-------
	0.2.1 beta.

Description:
------------
	This is a drop-in replacement for tnpipe.exe + telnetdc.exe pair.
It can be used with sshd or any other similar tool, i.e. your own telnetd.
Files:
	vioroute.dll - the vio handler.dll, that intercepts vio calls.
	vioroute.exe - the router that converts vio calls to terminal sequences.
			it also transfers input sequence to Os/2 keys.
	viostart.exe - the mediator between vioroute.exe and sshd.exe.
			it routes the stdin/stdout/stderr <-> vioroute's pipe.
	vioterm.exe  - the terminal changer. Being run under vioroute session,
			it changes the terminal, i.e. from ansi to vt100
	term.cfg     - the terminals config file.

Installation:
-------------
	Place vioroute.dll to your LIBPATH, vioroute.exe and vioterm.exe to your 
PATH, term.cfg to your ETC dir. 
	For use with sshd set the viostart.exe as the shell for the user. The 
corresponding line in passwd file should be like:

user:LkjhfLffFggfh:102:102::$d\home\user:$d\tcpip\bin\viostart.exe

Commandline switches:
---------------------
	vioroute.exe :

		-p <pipename>  : the name of the pipe where the terminal stream
				will be put.
		-d <directory> : the home directory.
		-t <term name> : the terminal name, i.e. ansi.
		-f <config>    : config file name. default is %ETC\term.cfg
		-s <shell>     : use <shell> as the shell. If not specified, the
				%COMSPEC will be used.
		-c or -cc      : execute a command. The command and its parameters
				should be after all vioroute switches.
		--debug        : debugging mode. viorexe.log and viorout
				files will be generated in current dir.
		--bescreen     : viorouter will work in screen mode. I.e. when
                                the viostart.exe that started this exemplar of
                                vioroute will be closed, the vioroute will stay 
                                running, and any other viostart.exe could connect
                                to it with a viostart --screen <vioroute's pid>.

	viostart.exe :

                --screen <pid> : connect to vioroute identified by pid that was
                                previously run in screen mode
		-c             : if the following argument does not start with 'vio+'
                                th following argument will be executed by the
                                command shell, otherwise it will be router to viooute.exe.
		all other switches are routed to vioroute.exe.

	vioterm.exe :
		
		<termname>     : the name of terminal to switch to. The specified
				terminal should be described in term.conf.

Config file syntax:
-------------------

; comment
; \E - ESC char, ASCII 27 (\0x1b or \033)
; \0xhh - Hex value of ASCII code
; \000  - Octal value of ASCII code

; macros:
;    $X - X cursor position, started from 1
;    $Y, $Y1 - Y cursor position, started from 1
;    $Ct - Color.Text code
;    $Cb - Color.Bg code

[ANSI] ; terminal name

; Text color. Fg = Text
Color.Fg.Black     30
Color.Fg.Red       31
Color.Fg.Green     32
Color.Fg.Yellow    33
Color.Text.Blue      34
Color.Text.Magenta   35
Color.Text.Cyan      36
Color.Text.White     37

; Background color
Color.Bg.Black       40
Color.Bg.Red         41
Color.Bg.Green       42
Color.Bg.Yellow      43
Color.Bg.Blue        44
Color.Bg.Magenta     45
Color.Bg.Cyan        46
Color.Bg.White       47

; Screen changes
Screen.Init          \Ec\E[?7h\E[2J\E[1;1H
Screen.Close         \E[2J\E[1;1H
Screen.Clear         \E[2J\E[1;1H

; Last char printing on/off switch
Screen.NoLastChar
; If set the cursor position will be explicitly send to terminal where it comes
; to the beginning of new line. It is usefull when your terminal window size is
; greater then viorouter's window size
;Screen.SetCursorOnNewLine
; Do cursor position's optimization. It reduces traffic and increases speed, 
; but sometimes you'll get 'wrong' cursor position.
Screen.CursorOptimize
; Replase beeps by given char.
;Screen.BeepChar     \0x20
; Replase Esc by given char.
;Screen.EscChar      '.'

; Cursor movement
Cursor.XY            \E[${Y};${X}H

; Attributes
Attrib.Normal        \E[0;${Ct};${Cb}m
Attrib.Bright        \E[0;1;${Ct};${Cb}m
Attrib.Blink         \E[0;5;${Ct};${Cb}m
Attrib.BrightBlink   \E[0;1;5;${Ct};${Cb}m

; Keys
	
; special keys
Key.CtrlC            \0x03
Key.Close            \0x1d
Key.Esc              \0x1b
Key.EscTimeout       1 ; esc timeout in milliseconds
; Only double esc sequence will be considered as esc key.
;Key.EscDoubleOnly

Key.Left             \E[D
Key.Right            \E[C
Key.Up               \E[A
Key.Down             \E[B

; functional keys
Key.F1               \EOP
Key.F2               \EOQ
Key.F3               \EOR
Key.F4               \EOS
Key.F5               \EOT
Key.F6               \E[17~
Key.F7               \E[18~
Key.F8               \E[19~
Key.F9               \E[20~
Key.F10              \E[21~
Key.F11              \E[35~
Key.F11              \E[36~

; alternative encoding
Key.F6               \EOU
Key.F7               \EOV
Key.F8               \EOW
Key.F9               \EOX
Key.F10              \EOY

; Ctrl+Fx
Key.Ctrl.F1           \EOa
Key.Ctrl.F2           \EOb
Key.Ctrl.F3           \EOc
Key.Ctrl.F4           \EOd
Key.Ctrl.F5           \EOe
Key.Ctrl.F6           \EOf
Key.Ctrl.F7           \EOg
Key.Ctrl.F8           \EOh
Key.Ctrl.F9           \EOi
Key.Ctrl.F10          \EOj

; the source encoding (codepage 866)
;Translate.From   ""
; the target encoding (KOI8-r)
;Translate.To "а                "

; etc

Known bugs and features:
------------------------
	Esc key handling - two esc one by one threated as one esc symbol according 
to standart. If one esc was received and the next char was received after
EscTimeout, that esc is threated as one esc symbol.

	The term.cfg file is uncompleted. Many key definitions are missing now, 
but you can easily add your definitions from unix termcaps files.

Any other bugs and features are welcome ;)

Bugreporting:
-------------
	Send your bugreports to author's email. Don't forget to attach the
zipped 'viorexe.log' and 'viorout' files, which are generated on --debug 
option.

Author:
-------
nickk, nickk@nm.ru

Greetings:
----------
zuko for help, haunting and non-conformism.
PornoXPEH for term.cfg replenishment.
Glassman for term.cfg replenishment.
Daniel Krueger for term.cfg replenishment.
Samm and Doug Rickman for intensive testing.

History:
--------

pre 0.2.1:
  - history is missing ;)

0.2.1:
  - added 'screen' mode to imitate the unix 'screen' utility. See --bescreen 
    and --screen keys in documentation.