Difference between revisions of "Unit RemoteShell"

From Ultibo.org
Jump to: navigation, search
Line 99: Line 99:
 
----
 
----
  
''To be documented''
+
 
 +
'''Telnet shell'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTelnetShell = class(TShell)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FListener:TTelnetListener;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>procedure TelnetConnected(AConnection:TTelnetConnection);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure TelnetDisconnected(AConnection:TTelnetConnection);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function TelnetInit(AConnection:TTelnetConnection):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function TelnetChar(AConnection:TTelnetConnection; AChar:Char):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function TelnetCommand(AConnection:TTelnetConnection; ACommand,AOption:Byte; AData:Pointer; ASize:LongWord):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Listener:TTelnetListener read FListener;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function DoClear(ASession:TShellSession):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function DoInput(ASession:TShellSession; var AInput:String):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function DoOutputEx(ASession:TShellSession; const AOutput:String; AReturn:Boolean):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function MatchSequence(const ASequence:String; var AContinue:Boolean):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessSequence(const ASequence:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Telnet session'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTelnetSession = class(TShellSession)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Command:String;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Sequence:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Position:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''SSH shell'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TSSHShell = class(TShell)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''Telnet shell logout'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTelnetShellLogout = class(TShellCommand)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>function DoHelp(AShell:TShell; ASession:TShellSession):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function DoInfo(AShell:TShell; ASession:TShellSession):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function DoCommand(AShell:TShell; ASession:TShellSession; AParameters:TStrings):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''SSH shell logout'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TSSHShellLogout = class(TShellCommand)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===

Revision as of 03:32, 20 March 2017

Return to Unit Reference


Description


Ultibo Remote Shell unit

To be documented

Constants



Remote shell specific constants REMOTE_SHELL_*
REMOTE_SHELL_DEFAULT_WELCOME = ' (Type HELP for a list of available commands)';  


Telnet shell constants TELNET_SHELL_*
TELNET_SHELL_NAME = 'Telnet Shell';  


Telnet shell command constants TELNET_SHELL_COMMAND_*
TELNET_SHELL_COMMAND_LOGOUT = 'LOGOUT';  


Telnet shell alias constants TELNET_SHELL_ALIAS_*
TELNET_SHELL_ALIAS_EXIT = 'EXIT';  


SSH shell constants SSH_SHELL_*
SSH_SHELL_NAME = 'SSH Shell';  


SSH shell command constants SSH_SHELL_COMMAND_*
SSH_SHELL_COMMAND_LOGOUT = 'LOGOUT';  


SSH shell alias constants SSH_SHELL_ALIAS_*
SSH_SHELL_ALIAS_EXIT = 'EXIT';  


Type definitions


None defined

Class definitions



Telnet shell

TTelnetShell = class(TShell)

public
constructor Create;  
destructor Destroy; override;  
private
FListener:TTelnetListener;  
protected
procedure TelnetConnected(AConnection:TTelnetConnection);  
procedure TelnetDisconnected(AConnection:TTelnetConnection);  
function TelnetInit(AConnection:TTelnetConnection):Boolean;  
function TelnetChar(AConnection:TTelnetConnection; AChar:Char):Boolean;  
function TelnetCommand(AConnection:TTelnetConnection; ACommand,AOption:Byte; AData:Pointer; ASize:LongWord):Boolean;  
public
property Listener:TTelnetListener read FListener;  
 
function DoClear(ASession:TShellSession):Boolean; override;  
 
function DoInput(ASession:TShellSession; var AInput:String):Boolean; override;  
 
function DoOutputEx(ASession:TShellSession; const AOutput:String; AReturn:Boolean):Boolean; override;  
 
function MatchSequence(const ASequence:String; var AContinue:Boolean):Boolean;  
function ProcessSequence(const ASequence:String):Boolean;  

Telnet session

TTelnetSession = class(TShellSession)

public
Command:String;  
Sequence:String;  
Position:LongWord;  
private
 
public
 

SSH shell

TSSHShell = class(TShell)

public
constructor Create;  
destructor Destroy; override;  
private
 
public
 

Telnet shell logout

TTelnetShellLogout = class(TShellCommand)

public
constructor Create;  
destructor Destroy; override;  
private
 
public
function DoHelp(AShell:TShell; ASession:TShellSession):Boolean; override;  
function DoInfo(AShell:TShell; ASession:TShellSession):Boolean; override;  
function DoCommand(AShell:TShell; ASession:TShellSession; AParameters:TStrings):Boolean; override;  

SSH shell logout

TSSHShellLogout = class(TShellCommand)

public
constructor Create;  
destructor Destroy; override;  
private
 
public
 


Public variables


None defined

Function declarations



Initialization functions

procedure RemoteShellInit;
Description: To be documented
Note None documented


Return to Unit Reference