libssh2_session_init_ex(3) libssh2 manual libssh2_session_init_ex(3)NAME
libssh2_session_init_ex - initializes an SSH session object
SYNOPSIS
#include <libssh2.h>
LIBSSH2_SESSION * libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*myalloc)), LIBSSH2_FREE_FUNC((*myfree)), LIBSSH2_REALLOC_FUNC((*myrealloc)),
void *abstract);
LIBSSH2_SESSION * libssh2_session_init(void);
DESCRIPTION
myalloc - Custom allocator function. Refer to the section on Callbacks for implementing an allocator callback. Pass a value of NULL to use
the default system allocator.
myfree - Custom de-allocator function. Refer to the section on Callbacks for implementing a deallocator callback. Pass a value of NULL to
use the default system deallocator.
myrealloc - Custom re-allocator function. Refer to the section on Callbacks for implementing a reallocator callback. Pass a value of NULL
to use the default system reallocator.
abstract - Arbitrary pointer to application specific callback data. This value will be passed to any callback function associated with the
named session instance.
Initializes an SSH session object. By default system memory allocators (malloc(), free(), realloc()) will be used for any dynamically allo-
cated 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.
This method must be called first, prior to configuring session options or starting up an SSH session with a remote server.
RETURN VALUE
Pointer to a newly allocated LIBSSH2_SESSION instance, or NULL on errors.
SEE ALSO libssh2_session_free(3)libssh2_session_handshake(3)libssh2 0.15 1 Jun 2007 libssh2_session_init_ex(3)
Check Out this Related Man Page
libssh2_session_callback_set(3) libssh2 manual libssh2_session_callback_set(3)NAME
libssh2_session_callback_set - set a callback function
SYNOPSIS
#include <libssh2.h>
void *libssh2_session_callback_set(LIBSSH2_SESSION *session,
int cbtype, void *callback);
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.
session - Session instance as returned by libssh2_session_init_ex(3)
cbtype - Callback type. One of the types listed in Callback Types.
callback - Pointer to custom callback function. The prototype for this function must match the associated callback declaration macro.
CALLBACK TYPES
LIBSSH2_CALLBACK_IGNORE
Called when a SSH_MSG_IGNORE message is received
LIBSSH2_CALLBACK_DEBUG
Called when a SSH_MSG_DEBUG message is received
LIBSSH2_CALLBACK_DISCONNECT
Called when a SSH_MSG_DISCONNECT message is received
LIBSSH2_CALLBACK_MACERROR
Called when a mismatched MAC has been detected in the transport layer. If the function returns 0, the packet will be accepted none-
theless.
LIBSSH2_CALLBACK_X11
Called when an X11 connection has been accepted
LIBSSH2_CALLBACK_SEND
Called when libssh2 wants to send some data on the connection. Can be set to a custom function to handle I/O your own way.
LIBSSH2_CALLBACK_RECV
Called when libssh2 wants to receive some data from the connection. Can be set to a custom function to handle I/O your own way.
RETURN VALUE
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_ex(3)libssh2 0.15 1 Jun 2007 libssh2_session_callback_set(3)
Hi,
We are currently implementing an Identity Management application which has several Unix systems as its target system. A pre-defined connector will be installed to provide connection between the Identity Management application and the Unix target system. The connection will use Public Key... (1 Reply)
Hi folks,
What I want to do is to check if there is an instance of running vlc on a remote server, then kill it, and start it again. The code I came up with is:
#!/bin/bash
expectFcn() {
expect -c "
set timeout -1
spawn ssh \"$1@$2\" \"$4\"
match_max 100000
expect {
-re... (2 Replies)
Can someone show me the basics on configuring SSH on Unix so I can access my Unix account remotely from Windows 7. Basically, I want to fire some scripts remotely.
I've already posted a thread on the Windows forum thinking my configuration was wrong on the Windows side. But the more I read the... (9 Replies)
Hi,
i have a text file as :
abc 0 1 Pass
hjk 1 1 Pass
bhk 0 0 Fail
jjh 8 2 Pass
nkji 0 1 Pass
Now I want to check that if 1st column is jjh , then , store the value of 3rd string of that line in a variable. Hence, 2... (8 Replies)
I've created a C tester based on the AIX libssh2.a library. It's running on the AIX server and communicates with a CISCO switch. The purpose is to use SSH instead of Telnet on my C++ process. The session opened (authentication...) fine, and I've succeeded to enable using the libssh2_channel_exec()... (2 Replies)