-
libssh2_init (integer)
global library initialization
Params:
Description:
Initialize the libssh2 functions. This typically initialize the
crypto library. It uses a global state, and is not thread safe.
You must make sure this function is not called concurrently.
Return:
Returns 0 if succeeded, or a negative value for error.
See also:
libssh2_exit()
-
libssh2_session_init ()
Description:
Initializes an SSH session object. By default system memory allocators
(malloc(), free(), realloc()) will be used for any dynamically allocated memory
blocks. Alternate memory allocation functions may be specified using the
extended version of this API call, and/or optional application specific data
may be attached to the session object.
Return:
Pointer to a newly allocated LIBSSH2_SESSION instance, or NULL on errors.
See also:
libssh2_session_free(), libssh2_session_startup()
-
libssh2_session_callback_set (atom, integer, atom)
set a callback function
Params:
-
atom session
Session instance as returned by libssh2_session_init_ex()
-
integer cbtype
Callback type. One of the types listed in Callback Types.
-
atom callback
Pointer to custom callback function. The prototype for this function must
match the associated callback declaration macro.
Description:
Sets a custom callback handler for a previously initialized session
object. Callbacks are triggered by the receipt of special packets at the
Transport layer. To disable a callback, set it to NULL.
Return:
Pointer to previous callback handler. Returns NULL if no prior callback
handler was set or the callback type was unknown.
See also:
libssh2_session_init()
-
libssh2_session_handshake (atom, atom)
Perform the SSH handshake
Params:
Return:
Returns: 0 on success, or non-zero on failure
See also:
libssh2_session_startup()
-
libssh2_session_startup (atom, integer)
begin transport layer
Params:
Description:
Starting in libssh2 version 1.2.8 this function is considered deprecated. Use
libssh2_session_handshake() instead.
Return:
Returns 0 on success, negative on failure.
See also:
libssh2_session_free(), libssh2_session_init()
-
libssh2_session_free (atom)
frees resources associated with a session instance
Params:
Description:
Frees all resources associated with a session instance.
Typically called after libssh2_session_disconnect_ex()
Return:
Return 0 on success or negative on failure. It returns
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
See also:
libssh2_session_init_ex(), libssh2_session_disconnect_ex()
-
libssh2_session_disconnect (atom, sequence)
terminate transport layer
Params:
Description:
Send a disconnect message to the remote host associated with session,
along with a SSH_DISCONNECT_BY_APPLICATION> symbol and a verbose
description.
Return:
Return 0 on success or negative on failure. It returns
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
See also:
libssh2_session_init()
-
libssh2_session_methods (atom, integer)
return the currently active algorithms
Params:
-
atom session
-
integer method_type
one of the method type constants: LIBSSH2_METHOD_KEX, LIBSSH2_METHOD_HOSTKEY,
LIBSSH2_METHOD_CRYPT_CS, LIBSSH2_METHOD_CRYPT_SC, LIBSSH2_METHOD_MAC_CS,
LIBSSH2_METHOD_MAC_SC, LIBSSH2_METHOD_COMP_CS, LIBSSH2_METHOD_COMP_SC,
LIBSSH2_METHOD_LANG_CS, LIBSSH2_METHOD_LANG_SC.
Description:
Returns the actual method negotiated for a particular transport parameter.
Return:
Negotiated method or NULL if the session has not yet been started.
See also:
libssh2_session_init()
-
libssh2_session_abstract (atom)
return a pointer to a session's abstract pointer
Params:
Description:
Return a pointer to where the abstract pointer provided to
libssh2_session_init_ex() is stored. By providing a doublyde-referenced pointer, the internal storage of the session instance may be
modified in place.
Return:
A pointer to session internal storage who's contents points to previously
provided abstract data.
See also:
libssh2_session_init()
-
libssh2_session_last_error (atom)
get the most recent error
Params:
Description:
Determine the most recent error condition and its cause.
Return:
Error message
See also:
libssh2_session_last_errno()
-
libssh2_session_last_errno (atom)
get the most recent error number
Params:
Description:
Determine the most recent error condition.
Return:
Numeric error code corresponding to the the Error Code constants.
See also:
libssh2_session_last_error()
-
libssh2_session_flag (atom, integer, integer)
Set options for the created session.
Params:
-
atom session
-
integer flag
* LIBSSH2_FLAG_SIGPIPE
If set, libssh2 will not attempt to block SIGPIPEs but will let them trigger
from the underlying socket layer.
* LIBSSH2_FLAG_COMPRESS
If set - before the connection negotiation is performed - libssh2 will try to
negotiate compression enabling for this connection. By default libssh2 will
not attempt to use compression.
-
integer value
Description:
flag is the option to set, while value is typically setto 1 or 0 to enable or disable the option.
Return:
Returns regular libssh2 error code.
-
libssh2_session_get_blocking (atom)
get blocking mode on session
Params:
Return:
Returns 0 if the state of the session has previously be set to non-blocking
and it returns 1 if the state was set to blocking.
See also:
libssh2_session_set_blocking()
-
libssh2_session_get_timeout (atom)
get the timeout for blocking functions
Params:
Description:
Returns the timeout (in milliseconds) for how long a blocking the
libssh2 function calls may wait until they consider the situation an error and
return LIBSSH2_ERROR_TIMEOUT.
By default libssh2 has no timeout (zero) for blocking functions.
Return:
The value of the timeout setting.
See also:
libssh2_session_set_timeout()
-
libssh2_poll (atom, integer, atom)
poll for activity on a socket, channel or listener
Params:
-
atom fds
-
integer nfds
-
atom timeout
Description:
This function is deprecated. Do note use. We encourage users to instead use
the poll() or select() functions to check for socket activity or
when specific sockets are ready to get recevied from or send to.
Poll for activity on a socket, channel, listener, or any combination of these
three types. The calling semantics for this function generally match
poll(2) however the structure of fds is somewhat more complex in orderto accommodate the disparate datatypes, POLLFD constants have been namespaced
to avoid platform discrepancies, and revents has additional values defined.
Return:
Number of fds with interesting events.
See also:
libssh2_poll_channel_read()
-
libssh2_poll_channel_read (atom, integer)
check if data is available
Params:
-
atom channel
-
integer extended
Description:
This function is deprecated. Do note use.
libssh2_poll_channel_read() checks to see if data is available in thechannel's read buffer. No attempt is made with this method to see ifpackets are available to be processed. For full polling support, use
libssh2_poll().
Return:
Returns 1 when data is available and 0 otherwise.
See also:
libssh2_poll()
-
libssh2_session_block_directions (atom)
get directions to wait for
Params:
Description:
When any of libssh2 functions return LIBSSH2_ERROR_EAGAIN an application
should wait for the socket to have data available for reading or
writing. Depending on the return value of
libssh2_session_block_directions() an application should wait for read,write or both.
Application should wait for data to be available for socket prior to calling a
libssh2 function again. If LIBSSH2_SESSION_BLOCK_INBOUND is set select
should contain the session socket in readfds set. Correspondingly in case of
LIBSSH2_SESSION_BLOCK_OUTBOUND writefds set should contain the socket.
Return:
Returns the set of directions as a binary mask. Can be a combination of:
* LIBSSH2_SESSION_BLOCK_INBOUND: Inbound direction blocked.
* LIBSSH2_SESSION_BLOCK_OUTBOUND: Outbound direction blocked.
-
libssh2_hostkey_hash (atom, integer)
Returns hash signature
Params:
-
atom session
-
integer hash_type
Description:
Returned buffer should NOT be freed
Length of buffer is determined by hash type
i.e. MD5 == 16, SHA1 == 20
-
libssh2_session_hostkey (atom, integer, integer)
get the remote key
Params:
-
atom session
-
integer len
-
integer Type
Description:
Returns a pointer to the current host key, the value len points to will
get the length of the key.
The value type points to the type of hostkey which is one of:
* LIBSSH2_HOSTKEY_TYPE_RSA, LIBSSH2_HOSTKEY_TYPE_DSS, or
* LIBSSH2_HOSTKEY_TYPE_UNKNOWN.
Return:
A pointer, or NULL if something went wrong.
See also:
libssh2_knownhost_check(), libssh2_knownhost_add()
-
libssh2_session_method_pref (atom, integer, atom)
set preferred key exchange method
Params:
-
atom session
Session instance as returned by libssh2_session_init()
-
integer method_type
One of the Method Type constants.
-
atom prefs
Comma delimited list of preferred methods to use with the most preferred
listed first and the least preferred listed last.
If a method is listed which is not supported by libssh2 it will be
ignored and not sent to the remote host during protocol negotiation.
Description:
Set preferred methods to be negotiated. These
preferrences must be set prior to calling libssh2_session_startup()
as they are used during the protocol initiation phase.
Return:
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN
when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative
number, it isn't really a failure per se.
See also:
libssh2_session_init(), libssh2_session_startup()
-
libssh2_userauth_list (atom, sequence)
list supported authentication methods
Params:
-
atom session
Session instance as returned by libssh2_session_init()
-
sequence username
Username which will be used while authenticating. Note that most server
implementations do not permit attempting authentication with different
usernames between requests. Therefore this must be the same username you
will use on later userauth calls.
Description:
Send a SSH_USERAUTH_NONE request to the remote host. Unless the remote
host is configured to accept none as a viable authentication scheme
(unlikely), it will return SSH_USERAUTH_FAILURE along with a listing of
what authentication schemes it does support. In the unlikely event that none
authentication succeeds, this method with return NULL. This case may be
distinguished from a failing case by examining
libssh2_userauth_authenticated().
Return:
On success a comma delimited list of supported authentication schemes. This
list is internally managed by libssh2. On failure returns NULL.
See also:
libssh2_session_init()
-
libssh2_userauth_authenticated (atom)
return authentication status
Params:
Description:
Indicates whether or not the named session has been successfully authenticated.
Return:
Returns 1 if authenticated and 0 if not.
See also:
libssh2_session_init()
-
libssh2_userauth_password (atom, sequence, sequence, atom)
authenticate a session with username and password
Params:
-
atom session
Session instance as returned by libssh2_session_init()
-
sequence username
Name of user to attempt plain password authentication for.
-
sequence password
Password to use for authenticating username.
-
atom passwd_change_cb
If the host accepts authentication but requests that the password be
changed, this callback will be issued.
If no callback is defined, but server required password change,
authentication will fail.
Description:
Attempt basic password authentication. Note that many SSH servers
which appear to support ordinary password authentication actually have
it disabled and use Keyboard Interactive authentication (routed via
PAM or another authentication backed) instead.
Return:
Return 0 on success or negative on failure. It returns
* LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
* LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
See also:
libssh2_session_init()
-
libssh2_userauth_publickey (atom, atom, sequence, atom, atom)
authenticate using a callback function
Params:
Description:
Authenticate with the sign_callback callback that matches the prototype
below
function name(atom session, atom sig, atom sig_len,
atom data, atom data_len, atom abstract)
Return:
Return 0 on success or negative on failure.
See also:
libssh2_userauth_publickey_fromfile()
-
libssh2_userauth_publickey_fromfile (atom, sequence, atom, atom, atom)
authenticate a session with a public key, read from a file
Params:
-
atom session
Session instance as returned by libssh2_session_init()
-
sequence username
Remote user name to authenticate as.
-
atom publickey
Path and name of public key file. (e.g. /etc/ssh/hostkey.pub)
-
atom privatekey
Path and name of private key file. (e.g. /etc/ssh/hostkey)
-
atom passphrase
Passphrase to use when decoding private key file.
Description:
Attempt public key authentication using a PEM encoded private key file stored on disk
Return:
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN
when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative
number, it isn't really a failure per se.
See also:
libssh2_session_init()
-
libssh2_userauth_hostbased_fromfile (atom, sequence, atom, atom, atom, sequence)
Params:
-
atom session
-
sequence username
-
atom publickey
-
atom privatekey
-
atom passphrase
-
sequence hostname
-
libssh2_userauth_keyboard_interactive (atom, sequence, atom)
authenticate a session using keyboard-interactive authentication
Params:
-
atom session
Session instance as returned by libssh2_session_init_ex().
-
sequence username
Name of user to attempt keyboard-interactive authentication for.
-
atom response_callback
As authentication proceeds, the host issues several (1 or more) challenges and
requires responses. This callback will be called at this moment. The callback
is responsible to obtain responses for the challenges, fill the provided data
structure and then return control. Responses will be sent to the host.
String values will be free()ed by the library.
The callback prototype must match this:
procedure response(atom name, integer name_len,
atom instruction, integer instruction_len,
integer num_prompts, atom prompts,
atom responses, atom abstract)
Description:
Attempts keyboard-interactive (challenge/response) authentication.
Note that many SSH servers will always issue a single "password" challenge,
requesting actual password as response, but it is not required by the
protocol, and various authentication schemes, such as smartcard authentication
may use keyboard-interactive authentication type too.
Return:
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN
when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative
number, it isn't really a failure per se.
See also:
libssh2_session_init()
-
libssh2_channel_forward_cancel (atom)
Params:
-
libssh2_channel_forward_accept (atom)
Params:
-
libssh2_channel_process_startup (atom, atom, integer, atom, integer)
Params:
-
atom channel
-
atom request
-
integer request_len
-
atom message
-
integer message_len
-
libssh2_channel_receive_window_adjust (atom, atom, integer)
Params:
-
atom channel
-
atom adjustment
-
integer force
-
libssh2_channel_receive_window_adjust2 (atom, atom, integer, atom)
Params:
-
atom channel
-
atom adjustment
-
integer force
-
atom storewindow
-
libssh2_channel_handle_extended_data2 (atom, integer)
Params:
-
atom channel
-
integer ignore_mode
-
libssh2_channel_get_exit_status (atom)
Params:
-
libssh2_channel_send_eof (atom)
Params:
-
libssh2_channel_eof (atom)
Params:
-
libssh2_channel_wait_eof (atom)
Params:
-
libssh2_channel_close (atom)
Params:
-
libssh2_channel_wait_closed (atom)
Params:
-
libssh2_channel_free (atom)
Params:
-
libssh2_base64_decode (atom, atom, atom, atom, integer)
decode a base64 encoded string
Params:
-
atom session
-
atom dest
-
atom dest_len
-
atom src
-
integer src_len
Description:
This function is deemed DEPRECATED and will be removed from libssh2 in a
future version. Don't use it!
Decode a base64 chunk and store it into a newly allocated buffer.
'dest_len' will be set to hold the length of the returned buffer that '*dest'
will point to.
The returned buffer is allocated by this function, but it is not clear how to
free that memory!
-
libssh2_version (integer)
return the libssh2 version number
Params:
Description:
If required_version is lower than or equal to the version number of the
libssh2 in use, the version number of libssh2 is returned
Return:
The version number of libssh2 is returned or NULL if the
required_version isn't fulfilled.
Example:
To make sure you run with the correct libssh2 version:
if not libssh2_version(LIBSSH2_VERSION_NUM) then
printf (2, "Runtime libssh2 version too old!\n")
abort(1)
end if
Unconditionally get the version number:
printf(1, "libssh2 version: %s", libssh2_version(0) )
-
libssh2_knownhost_init (atom)
Init a collection of known hosts.
Params:
Return:
Returns the pointer to a collection.
-
libssh2_knownhost_add (atom, atom, atom, atom, atom, integer, atom)
Add a host and its associated key to the collection of known hosts.
Params:
-
atom hosts
-
atom host
-
atom salt
-
atom key
-
atom keylen
-
integer typemask
-
atom store
Description:
The 'type' argument specifies on what format the given host is:
plain - ascii "hostname.domain.tld"
sha1 - SHA1( ) base64-encoded!
custom - another hash
If 'sha1' is selected as type, the salt must be provided to the salt
argument. This too base64 encoded.
The SHA-1 hash is what OpenSSH can be told to use in known_hosts files. If
a custom type is used, salt is ignored and you must provide the host
pre-hashed when checking for it in the libssh2_knownhost_check() global function.
-
libssh2_knownhost_addc (atom, atom, atom, atom, atom, atom, atom, integer, atom)
Add a host and its associated key to the collection of known hosts.
Params:
-
atom hosts
-
atom host
-
atom salt
-
atom key
-
atom keylen
may be omitted (zero) if the key is provided as a NULL-terminated
base64-encoded string.
-
atom comment
NULL indicates there is no comment and the entry will end directly after the
key when written out to a file.
An empty string "" will indicate an empty comment which will cause a single
space to be written after the key.
-
atom commentlen
-
integer typemask
-
atom store
Description:
The 'type' argument specifies on what format the given host and keys are:
plain - ascii "hostname.domain.tld"
sha1 - SHA1( ) base64-encoded!
custom - another hash
If 'sha1' is selected as type, the salt must be provided to the salt
argument. This too base64 encoded.
The SHA-1 hash is what OpenSSH can be told to use in known_hosts files. If
a custom type is used, salt is ignored and you must provide the host
pre-hashed when checking for it in the libssh2_knownhost_check() global function.
-
libssh2_knownhost_check (atom, atom, atom, atom, integer, atom)
Check a host and its associated key against the collection of known hosts.
Params:
Description:
The type is the type/format of the given host name.
plain - ascii "hostname.domain.tld"
custom - prehashed base64 encoded. Note that this cannot use any salts.
Return:
LIBSSH2_KNOWNHOST_CHECK_* values
-
libssh2_knownhost_checkp (atom, sequence, integer, atom, atom, integer, atom)
Check a host and its associated key against the collection of known hosts.
Params:
-
atom hosts
-
sequence host
-
integer port
-
atom key
-
atom keylen
-
integer typemask
-
atom knownhost
Description:
this global function is identical to libssh2_knownhost_check but takes an
additional port argument that allows libssh2 to do a better check
-
libssh2_knownhost_del (atom, atom)
Remove a host from the collection of known hosts.
Params:
Description:
The 'entry' struct is retrieved by a call to libssh2_knownhost_check().
-
libssh2_knownhost_readline (atom, atom, atom, integer)
Pass in a line of a file of 'type'. It makes libssh2 read this line.
Params:
-
atom hosts
-
atom line
-
atom len
-
integer Type
Description:
LIBSSH2_KNOWNHOST_FILE_OPENSSH is the only supported type.
-
libssh2_knownhost_readfile (atom, sequence, integer)
Add hosts+key pairs from a given file.
Params:
-
atom hosts
-
sequence filename
-
integer Type
Description:
This implementation currently only knows one 'type'
(LIBSSH2_KNOWNHOST_FILE_OPENSSH), all others are reserved for future use.
Return:
Returns a negative value for error or number of successfully added hosts.
-
libssh2_knownhost_writeline (atom, atom, atom, atom, atom, integer)
Ask libssh2 to convert a known host to an output line for storage.
Params:
-
atom hosts
-
atom known
-
atom buffer
-
atom buflen
-
atom outlen
-
integer Type
Description:
This implementation currently only knows one 'type' (openssh), all others
are reserved for future use.
Return:
returns LIBSSH2_ERROR_BUFFER_TOO_SMALL if the given output buffer is too
small to hold the desired output.
-
libssh2_knownhost_writefile (atom, sequence, integer)
Write hosts+key pairs to a given file.
Params:
-
atom hosts
-
sequence filename
-
integer Type
Description:
This implementation currently only knows one 'type' (openssh), all others
are reserved for future use.
-
libssh2_knownhost_get (atom, atom, atom)
Traverse the internal list of known hosts.
Params:
-
atom hosts
-
atom store
-
atom prev
Description:
Pass NULL to 'prev' to get the first one, or pass a pointer to the
previously returned one to get the next.
Return:
Returns:
* 0 if a fine host was stored in 'store'
* 1 if end of hosts
* [negative] on errors
-
libssh2_agent_init (atom)
Init an ssh-agent handle.
Params:
Return:
Returns the pointer to the handle.
-
libssh2_agent_connect (atom)
Connect to an ssh-agent.
Params:
Return:
Returns 0 if succeeded, or a negative value for error.
-
libssh2_agent_list_identities (atom)
Request an ssh-agent to list identities.
Params:
Return:
Returns 0 if succeeded, or a negative value for error.
-
libssh2_agent_get_identity (atom, atom, atom)
Traverse the internal list of public keys.
Params:
-
atom agent
-
atom store
-
atom prev
Description:
Pass NULL to 'prev' to get the first one, or pass a pointer to the previously
returned one to get the next.
Return:
Returns:
* 0 if a fine public key was stored in 'store'
* 1 if end of public keys
[negative] on errors
-
libssh2_agent_userauth (atom, atom, atom)
Do publickey user authentication with the help of ssh-agent.
Params:
-
atom agent
-
atom pointer
-
atom identity
Return:
Returns 0 if succeeded, or a negative value for error.
-
libssh2_agent_disconnect (atom)
Close a connection to an ssh-agent.
Params:
Return:
Returns 0 if succeeded, or a negative value for error.
-
libssh2_keepalive_send (atom)
Send a keepalive message if needed.
Params:
-
atom session
session handle
Return:
Returns how many seconds you can sleep after this call before you need to
call it again on success, or -1 if failed.
-
libssh2_trace (atom, integer)
Params:
-
atom session
-
integer bitmask
-
libssh2_trace_sethandler (atom, atom, atom)
Params:
-
atom session
-
atom context
-
atom callback
-
libssh2_channel_open_session (atom)
Params:
-
libssh2_channel_direct_tcpip (atom, sequence, integer, sequence, integer)
Params:
-
atom session
-
sequence host
-
integer port
-
sequence shost
-
integer sport
-
libssh2_channel_forward_listen (atom, integer)
Params:
-
atom session
-
integer port
-
libssh2_channel_setenv (atom, sequence, sequence)
Params:
-
atom channel
-
sequence varname
-
sequence value
-
libssh2_channel_request_pty (atom, sequence)
Params:
-
atom channel
-
sequence term
-
libssh2_channel_request_pty_size (atom, integer, integer)
Params:
-
atom channel
-
integer width
-
integer height
-
libssh2_channel_x11_req (atom, integer)
Params:
-
atom channel
-
integer screen_number
-
libssh2_channel_shell (atom)
Params:
-
libssh2_channel_exec (atom, sequence)
Params:
-
atom channel
-
sequence command
-
libssh2_channel_subsystem (atom, sequence)
Params:
-
atom channel
-
sequence subsystem
-
libssh2_channel_read_ex (atom, integer, atom, integer)
read data from a channel stream
Params:
Description:
Attempt to read data from an active channel stream.
Return:
Actual number of bytes read or negative on failure. It returns
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
Note that a return value of zero (0) can in fact be a legitimate value and
only signals that no payload data was read. It is not an error.
See also:
libssh2_poll_channel_read()
-
libssh2_channel_read (atom, atom, integer)
read data from a channel stream
Params:
Description:
Attempt to read data from an active channel stream.
-
libssh2_channel_read_stderr (atom, atom, integer)
Params:
-
atom channel
-
atom buf
-
integer buflen
-
libssh2_channel_window_read (atom)
Params:
-
libssh2_channel_write (atom, atom, integer)
Check the status of the write window
Params:
-
atom channel
-
atom buf
-
integer buflen
Description:
Returns the number of bytes which may be safely written on the channel
without blocking. 'window_size_initial' (if passed) will be populated with
the size of the initial window as defined by the channel_open request
-
libssh2_channel_write_stderr (atom, atom, integer)
Params:
-
atom channel
-
atom buf
-
integer buflen
-
libssh2_channel_window_write (atom)
Params:
-
libssh2_channel_flush (atom)
Params:
-
libssh2_channel_flush_stderr (atom)
Params:
-
libssh2_scp_send (atom, atom, integer, integer)
Send a file via SCP
Params:
-
atom session
Session instance as returned by libssh2_session_init_ex()
-
atom path
Full path and filename of file to transfer to. That is the remote file name.
-
integer mode
File access mode to create file with
-
integer size
Size of file being transmitted (Must be known ahead of time precisely)
Description:
Deprecated since libssh2 1.2.6. Use libssh2_scp_send64() instead.
Return:
Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
See also:
libssh2_channel_open(), libssh2_scp_send64()
-
libssh2_scp_send64 (atom, atom, integer, atom, atom, atom)
Send a file via SCP
Params:
-
atom session
Session instance as returned by libssh2_session_init()
-
atom path
Full path and filename of file to transfer to. That is the remote file name.
-
integer mode
File access mode to create file with
-
atom size
Size of file being transmitted (Must be known ahead of time).
Note that this needs to be passed on as variable type uint64.
This type is 64 bit on modern operating systems and compilers.
-
atom mtime
mtime to assign to file being created
-
atom atime
atime to assign to file being created (Set this and mtime to zero to
instruct remote host to use current time).
Return:
Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
See also:
libssh2_channel_open()
-
libssh2_scp_recv (atom, atom, atom)
request a remote file via SCP
Params:
-
atom session
Session instance as returned by libssh2_session_init()
-
atom path
Full path and filename of file to transfer. That is the remote file name.
-
atom sb
Populated with remote file's size, mode, mtime, and atime
Description:
This receives files larger than 2 GB, but is unable to report the proper size
on platforms where the st_size member of struct stat is limited to 2 GB
(e.g. windows).
Return:
Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
See also:
libssh2_session_init(), libssh2_channel_open()