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

Status:
-------
	0.0.1 pre-alpha. mainly for testing, bugreporing and feature suggesting 
purposes.

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
		-c             : 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.
		--showpid      : viorouter will send its pid as 4bytes in host
				order to the pipe prior to the terminal stream.

	vioshell.exe :
		
		all 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
; any other chars send as is.

; 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

; 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

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

; 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 cursor positions sometimes displayed wrong. It can be displayed 
properly everytime, but this requires more intensive traffic. So, what is better ???

	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.