Back to product page

RemoteIdentification function


Holds the remote identification string.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_GetRemoteIdentification(void *Sftp, char *Buffer, int *Bufsize);
The RemoteIdentification(void *Sftp,char *Buffer,int *Bufsize) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *BufferBuffer that will hold the returned string.
int *BufsizeSize of the buffer.

Remarks

Once an initial connection is established with the server, the SSH protocol specifies that both parties should exchange version information. This information includes the server/client type, and the version supported. Typically, this would be something like
    SSH-1.99-OpenSSH_2.9p2
which means that server supports the SSH protocol versions SSH1 and SSH2, and the server type is OpenSSH running version 2.9p2. Other values can apply here, too. The first part of the string is the important part,
    SSH-1.99
1.99 means that the server supports both SSH1 and SSH2 protocols. If only SSH1 is supported, then server would usually reply with SSH-1.5, and if only SSH2 is supported it would usually reply with SSH-2.0.

wodSFTP can work only with SSH2 servers! This is due to the SFTP protocol specification, not to our implementation.

The Bufsize variable should contain the maximum data length that can be stored in the Buffer variable. If you set Bufsize = 0, then the function will return with error ERROR_INSUFFICIENT_BUFFER and Bufsize will contain the required buffer size.

Platforms

Windows