Channel Controls and VIs
Owning Palette: Toolkit
Requires: LIBSSH2
Represents a SSH channel. A SSH channel is a bidirectional communication connection between two computers. The SSH channel is created after a SSH session has been established and the user has been authenticated. Note, multiple channels can exist for a single SSH session.
Class Item | Description |
---|---|
Type Definitions | Groups related files into a folder |
Change Receive Window Size | Adjusts the receive window size in bytes. |
Create | Creates a new Channel object that represents a libssh2lv shared library Channel struct. This VI must be called, or executed, before using any other Channel-related VIs. This VI allocates memory within the libssh2lv shared library that must be explicitly deallocated, or freed, at the end of the application using the Destroy VI to avoid memory leaks or running Out-of-Memory (OOM) on a resource contrained system. A Channel object represents a bi-directional stream of communication with a remote SSH server. |
Destroy | Deallocates, or frees, the memory allocated for the libssh2lv shared library Channel struct represented by this Channel object. After this is called, the object can no longer be used in the application without causing a segmentation fault, i.e. crashing LabVIEW. This VI must be called to avoid leaking memory or running Out-of-Memory (OOM) on resource-constrained systems. |
Execute | Creates a single execution context for a SSH channel. To execute multiple commands, either this channel needs to be destroyed and new channel created, or a Shell channel should be used instead. |
Flush | Forces the internal libssh2lv shared library write buffer to send all binary data to the remote SSH server within the SSH channel. |
Read All Stderr | Reads binary data from the STDERR stream of a SSH channel represented by this Channel object in chunks, or blocks, until the total read size is reached. This VI should be used if the Total Read Size is greater than 30KB because of a hard-coded per-read maximum of 30KB defined in the libssh2lv shared library. |
Read All | Reads binary data from a SSH channel represented by this Channel object in chunks, or blocks, until the total read size is reached. This VI should be used if the Total Read Size is greater than 30KB because of a hard-coded per-read maximum of 30KB set in the libssh2lv shared library. |
Read End-of-File | Determines if the remote SSH server is at the End-of-File (EOF). |
Read Exit Status | Gets the exit status code for an Exec-style channel. |
Read Stderr | Reads binary data from the remote SSH server's STDERR stream through the SSH channel represented by this Channel object. The Max Data Length must be greater than or equal to the expected data that is returned from the remote SSH server to avoid an error. Note, there is a hard-coded maximum of 30KB in the libssh2lv shared library. If the expected data is greater than 30KB, then this VI should be executed in a loop that accummlates the Data array size for each execution and stops when the total binary data size has been reached. |
Read Window Read Size | Gets the window read size in bytes (B). |
Read Window Write Size | Gets the window write size in bytes (B). |
Read | Reads binary data from the SSH channel represented by this Channel object. The Max Data Length must be greater than or equal to the expected data that is returned from the remote SSH server to avoid an error. However, there is a hard-coded maximum of 30KB in the libssh2lv shared library. If the expected binary data is greater than 30KB, then the Read All should be used. |
Send Done | Sends a signal to the remote SSH server that no more data will be sent. It is generally good practice to send this signal before destroying the SSh channel. |
Send End-of-File | Sends the End-of-File (EOF) signal to the remote SSH server indicating all of the bytes from a file has been sent. |
Set Environment Variable | Sets the value for an environment variable for a Shell channel. |
Shell | Creates a Shell channel for bidirectional communication with a STDIN, STDOUT, and STDERR streams. |
Subsystem | Creates a Subsystem SSH channel. |
Wait for Done | Waits for the remote SSH/SFTP server sends acknowledgement that no more data will be sent from the local machine to the server. |
Wait for End-of-File | Waits until the End-of-File (EOF) is received from the remote SSH/SFTP server. This is always a blocking operation. |
Write All Stderr | Writes binary data to the STDERR stream of the SSH channel represented by this Channel object until all of the data (bytes) are written. If the binary data is larger than 30KB, then the data is written in 30KB chunks, or blocks, until the Write Count equals the Data array size. |
Write All | Writes binary data to the SSH channel represented by this Channel object until all of the data (bytes) are written. If the binary data is larger than 30KB, then the data is written in 30KB chunks, or blocks, until the Write Count equals the Data array size. |
Write Ignore Mode | Sets the kind of ignore response for this channel. |
Write Mode | Sets the type communication for this channel. |
Write Stderr | Writes binary data to the STDERR stream of the SSH channel represented by this Channel object. Only the first 30KB of the binary data will be written to the remote SSH server's STDERR stream because of a hard-coded 30KB maximum data length in the libssh2lv shared library. If the binary data is larger than 30KB, then this VI should be used in a While loop where multiple writes of smaller chunks, or blocks, to the STDERR stream occur until all of the binary data has been written. |
Write Terminal | Sets the kind of terminal to use with a Shell-style channel. |
Write Terminal Size | Sets the terminal size in pixels (px). |
Write X11 | Selects the screen on the remote SSH server to use when X11 forwarding. |
Write | Writes binary data to the SSH channel represented by this Channel object. Only the first 30KB of the binary data will be written to the remote SSH server because of a hard-coded 30KB maximum data length in the libssh2lv shared library. For binary data greater than 30KB, the Write All VI should be used instead. |