SetSSHParam Method

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

Syntax

ANSI (Cross Platform)
char* SetSSHParam(const char* lpPayload, int lenPayload, const char* lpszFieldType, const char* lpszFieldValue, int *lpSize = NULL);

Unicode (Windows)
LPSTR SetSSHParam(LPCSTR lpPayload, INT lenPayload, LPCWSTR lpszFieldType, LPCWSTR lpszFieldValue, LPINT lpSize = NULL);
- (NSData*)setSSHParam:(NSData*)payload :(NSString*)fieldType :(NSString*)fieldValue;
#define MID_SFTP_SETSSHPARAM 21

IPWORKSEDI_EXTERNAL int IPWORKSEDI_CALL IPWorksEDI_SFTP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

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 (C++)

This method returns a Binary String value (with length lpSize); 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) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 C++ Edition - Version 20.0 [Build 8203]