SetSSHParam Method

Used to write a field to the end of a payload.

Syntax

QByteArray SetSSHParam(const QByteArray& qbaPayload, const QString& qsFieldType, const QString& qsFieldValue);

Remarks

This method is used to build the payload portion of an SSH packet to be sent later by a call to SendSSHPacket. Payload should contain the result of a previous call to SetSSHParam. FieldType is a string defining the type of field to be written to the packet. FieldValue should be the string representation of the field to be written.

The following is a list of supported field types and a description of how FieldValue should be encoded:

sA plaintext string containing the default system encoding of the data.
sbA string containing the hex encoded data. (eg: "A1B23C")
mA variable-length large integer, encoded as a textual representation of the value ("1234").
iA 32-bit integer, encoded as a textual representation of the value (eg: "1234").
lA 64-bit integer, encoded as a textual representation of the value (eg: "1234").
bA single byte, encoded as a textual representation of the value (eg: "123").
fA boolean flag, encoded as a textual representation of the value (eg: 'true' or 'false')

Note: integer values may be encoded in hexadecimal by prefixing "0x" to the beginning of the string, otherwise the value is assumed to be base-10.

Note: This method is only applicable for reading and creating SSH packets for use within the SSHCustomAuth event.

Error Handling

This method returns a Binary String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 Qt Edition - Version 20.0 [Build 8501]