Tamir.SharpSsh.SshStream Class Reference

A Stream based SSH class. More...

List of all members.

Public Member Functions

 SshStream (string host, string username, string password)
 Constructs a new SSH stream.
override int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
virtual int Read (byte[] buffer)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
override int ReadByte ()
 Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
override void WriteByte (byte value)
 Writes a byte to the current position in the stream and advances the position within the stream by one byte.
override void Write (byte[] buffer, int offset, int count)
 Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
virtual void Write (byte[] buffer)
 Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
void Write (String data)
 Writes a String into the SSH channel. This method appends an 'end of line' character to the input string.
override void Close ()
 Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
override void Flush ()
 Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
override void SetLength (long value)
 This method has no effect on the Stream.
override long Seek (long offset, SeekOrigin origin)
 This method has no effect on the Stream.
string ReadResponse ()
 Reads a response string from the SSH channel. This method will block until the pattern in the 'Prompt' property is matched in the response.

Properties

override bool CanRead [get]
 Gets a value indicating whether the current stream supports reading.
override bool CanWrite [get]
 Gets a value indicating whether the current stream supports writing.
override bool CanSeek [get]
 Gets a value indicating whether the current stream supports seeking. This stream cannot seek, and will always return false.
override long Length [get]
 Gets the length in bytes of the stream.
override long Position [get, set]
 Gets or sets the position within the current stream. This Stream cannot seek. This property has no effect on the Stream and will always return 0.
string Prompt [get, set]
 A regular expression pattern string to match when reading the resonse using the ReadResponse() method. The default prompt value is "\n" which makes the ReadRespons() method return one line of response.
bool RemoveTerminalEmulationCharacters [get, set]
 Gets or sets a value indicating wether this Steam sould remove the terminal emulation's escape sequence characters from the response String.
string Cipher [get]
 Gets the Cipher algorithm name used in this SSH connection.
string Mac [get]
 Gets the MAC algorithm name used in this SSH connection.
string ServerVersion [get]
 Gets the server SSH version string.
string ClientVersion [get]
 Gets the client SSH version string.


Detailed Description

A Stream based SSH class.

Definition at line 25 of file SshStream.cs.


Constructor & Destructor Documentation

Tamir.SharpSsh.SshStream.SshStream ( string  host,
string  username,
string  password 
)

Constructs a new SSH stream.

Parameters:
host The hostname or IP address of the remote SSH machine
username The name of the user connecting to the remote machine
password The password of the user connecting to the remote machine

Definition at line 42 of file SshStream.cs.


Member Function Documentation

override void Tamir.SharpSsh.SshStream.Close (  ) 

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.

Definition at line 140 of file SshStream.cs.

override void Tamir.SharpSsh.SshStream.Flush (  ) 

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

Definition at line 190 of file SshStream.cs.

virtual int Tamir.SharpSsh.SshStream.Read ( byte[]  buffer  )  [virtual]

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters:
buffer An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count- 1) replaced by the bytes read from the current source.
Returns:
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.

Definition at line 83 of file SshStream.cs.

override int Tamir.SharpSsh.SshStream.Read ( byte[]  buffer,
int  offset,
int  count 
)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters:
buffer An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count- 1) replaced by the bytes read from the current source.
offset The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
count The maximum number of bytes to be read from the current stream.
Returns:
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.

Definition at line 73 of file SshStream.cs.

override int Tamir.SharpSsh.SshStream.ReadByte (  ) 

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

Returns:
The unsigned byte cast to an Int32, or -1 if at the end of the stream.

Definition at line 92 of file SshStream.cs.

string Tamir.SharpSsh.SshStream.ReadResponse (  ) 

Reads a response string from the SSH channel. This method will block until the pattern in the 'Prompt' property is matched in the response.

Returns:
A response string from the SSH server.

Definition at line 289 of file SshStream.cs.

override long Tamir.SharpSsh.SshStream.Seek ( long  offset,
SeekOrigin  origin 
)

This method has no effect on the Stream.

Definition at line 230 of file SshStream.cs.

override void Tamir.SharpSsh.SshStream.SetLength ( long  value  ) 

This method has no effect on the Stream.

Definition at line 223 of file SshStream.cs.

void Tamir.SharpSsh.SshStream.Write ( String  data  ) 

Writes a String into the SSH channel. This method appends an 'end of line' character to the input string.

Parameters:
data The String to write to the SSH channel.

Definition at line 130 of file SshStream.cs.

virtual void Tamir.SharpSsh.SshStream.Write ( byte[]  buffer  )  [virtual]

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Parameters:
buffer An array of bytes. This method copies count bytes from buffer to the current stream.

Definition at line 121 of file SshStream.cs.

override void Tamir.SharpSsh.SshStream.Write ( byte[]  buffer,
int  offset,
int  count 
)

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Parameters:
buffer An array of bytes. This method copies count bytes from buffer to the current stream.
offset The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
count The number of bytes to be written to the current stream.

Definition at line 112 of file SshStream.cs.

override void Tamir.SharpSsh.SshStream.WriteByte ( byte  value  ) 

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

Parameters:
value The byte to write to the stream.

Definition at line 101 of file SshStream.cs.


Property Documentation

override bool Tamir.SharpSsh.SshStream.CanRead [get]

Gets a value indicating whether the current stream supports reading.

Definition at line 158 of file SshStream.cs.

override bool Tamir.SharpSsh.SshStream.CanSeek [get]

Gets a value indicating whether the current stream supports seeking. This stream cannot seek, and will always return false.

Definition at line 180 of file SshStream.cs.

override bool Tamir.SharpSsh.SshStream.CanWrite [get]

Gets a value indicating whether the current stream supports writing.

Definition at line 169 of file SshStream.cs.

string Tamir.SharpSsh.SshStream.Cipher [get]

Gets the Cipher algorithm name used in this SSH connection.

Definition at line 257 of file SshStream.cs.

string Tamir.SharpSsh.SshStream.ClientVersion [get]

Gets the client SSH version string.

Definition at line 281 of file SshStream.cs.

override long Tamir.SharpSsh.SshStream.Length [get]

Gets the length in bytes of the stream.

Definition at line 199 of file SshStream.cs.

string Tamir.SharpSsh.SshStream.Mac [get]

Gets the MAC algorithm name used in this SSH connection.

Definition at line 265 of file SshStream.cs.

override long Tamir.SharpSsh.SshStream.Position [get, set]

Gets or sets the position within the current stream. This Stream cannot seek. This property has no effect on the Stream and will always return 0.

Definition at line 210 of file SshStream.cs.

string Tamir.SharpSsh.SshStream.Prompt [get, set]

A regular expression pattern string to match when reading the resonse using the ReadResponse() method. The default prompt value is "\n" which makes the ReadRespons() method return one line of response.

Definition at line 239 of file SshStream.cs.

bool Tamir.SharpSsh.SshStream.RemoveTerminalEmulationCharacters [get, set]

Gets or sets a value indicating wether this Steam sould remove the terminal emulation's escape sequence characters from the response String.

Definition at line 248 of file SshStream.cs.

string Tamir.SharpSsh.SshStream.ServerVersion [get]

Gets the server SSH version string.

Definition at line 273 of file SshStream.cs.


The documentation for this class was generated from the following file:

Generated on Wed Jul 21 15:05:30 2010 for SharpSSH by  doxygen 1.5.9