libssh
0.5.4
|
Data Structures | |
struct | ssh_bind_callbacks |
These are the callbacks exported by the ssh_bind structure. More... | |
Typedefs | |
typedef void(* | ssh_bind_incoming_connection_callback )(ssh_bind sshbind, void *userdata) |
Incoming connection callback. More... | |
Functions | |
LIBSSH_API int | ssh_bind_accept (ssh_bind ssh_bind_o, ssh_session session) |
Accept an incoming ssh connection and initialize the session. More... | |
LIBSSH_API void | ssh_bind_fd_toaccept (ssh_bind ssh_bind_o) |
Allow the file descriptor to accept new sessions. More... | |
LIBSSH_API void | ssh_bind_free (ssh_bind ssh_bind_o) |
Free a ssh servers bind. More... | |
LIBSSH_API socket_t | ssh_bind_get_fd (ssh_bind ssh_bind_o) |
Recover the file descriptor from the session. More... | |
LIBSSH_API int | ssh_bind_listen (ssh_bind ssh_bind_o) |
Start listening to the socket. More... | |
LIBSSH_API ssh_bind | ssh_bind_new (void) |
Creates a new SSH server bind. More... | |
LIBSSH_API int | ssh_bind_options_set (ssh_bind sshbind, enum ssh_bind_options_e type, const void *value) |
Set the options for the current SSH server bind. More... | |
LIBSSH_API void | ssh_bind_set_blocking (ssh_bind ssh_bind_o, int blocking) |
Set the session to blocking/nonblocking mode. More... | |
LIBSSH_API int | ssh_bind_set_callbacks (ssh_bind sshbind, ssh_bind_callbacks callbacks, void *userdata) |
Set the callback for this bind. More... | |
LIBSSH_API void | ssh_bind_set_fd (ssh_bind ssh_bind_o, socket_t fd) |
Set the file descriptor for a session. More... | |
LIBSSH_API int | ssh_handle_key_exchange (ssh_session session) |
Handles the key exchange and set up encryption. More... | |
LIBSSH_API void | ssh_set_message_callback (ssh_session session, int(*ssh_bind_message_callback)(ssh_session session, ssh_message msg, void *data), void *data) |
defines the ssh_message callback More... | |
typedef void(* ssh_bind_incoming_connection_callback)(ssh_bind sshbind, void *userdata) |
Incoming connection callback.
This callback is called when a ssh_bind has a new incoming connection.
sshbind | Current sshbind session handler |
message | the actual message |
userdata | Userdata to be passed to the callback function. |
int ssh_bind_accept | ( | ssh_bind | ssh_bind_o, |
ssh_session | session | ||
) |
Accept an incoming ssh connection and initialize the session.
ssh_bind_o | The ssh server bind to accept a connection. |
session | A preallocated ssh session |
References privatekey_free().
void ssh_bind_fd_toaccept | ( | ssh_bind | ssh_bind_o | ) |
Allow the file descriptor to accept new sessions.
ssh_bind_o | The ssh server bind to use. |
void ssh_bind_free | ( | ssh_bind | ssh_bind_o | ) |
Free a ssh servers bind.
ssh_bind_o | The ssh server bind to free. |
socket_t ssh_bind_get_fd | ( | ssh_bind | ssh_bind_o | ) |
Recover the file descriptor from the session.
ssh_bind_o | The ssh server bind to get the fd from. |
int ssh_bind_listen | ( | ssh_bind | ssh_bind_o | ) |
Start listening to the socket.
ssh_bind_o | The ssh server bind to use. |
References ssh_init().
ssh_bind ssh_bind_new | ( | void | ) |
Creates a new SSH server bind.
LIBSSH_API int ssh_bind_options_set | ( | ssh_bind | sshbind, |
enum ssh_bind_options_e | type, | ||
const void * | value | ||
) |
Set the options for the current SSH server bind.
sshbind | The ssh server bind to configure. |
type | The option type to set. This could be one of the following: |
value | The value to set. This is a generic pointer and the datatype which is used should be set according to the type set. |
void ssh_bind_set_blocking | ( | ssh_bind | ssh_bind_o, |
int | blocking | ||
) |
Set the session to blocking/nonblocking mode.
ssh_bind_o | The ssh server bind to use. |
blocking | Zero for nonblocking mode. |
int ssh_bind_set_callbacks | ( | ssh_bind | sshbind, |
ssh_bind_callbacks | callbacks, | ||
void * | userdata | ||
) |
Set the callback for this bind.
[in] | sshbind | The bind to set the callback on. |
[in] | callbacks | An already set up ssh_bind_callbacks instance. |
[in] | userdata | A pointer to private data to pass to the callbacks. |
void ssh_bind_set_fd | ( | ssh_bind | ssh_bind_o, |
socket_t | fd | ||
) |
Set the file descriptor for a session.
ssh_bind_o | The ssh server bind to set the fd. |
fd | The file descriptssh_bind B |
int ssh_handle_key_exchange | ( | ssh_session | session | ) |
Handles the key exchange and set up encryption.
session | A connected ssh session |
References ssh_log(), and SSH_LOG_PACKET.
void ssh_set_message_callback | ( | ssh_session | session, |
int(*)(ssh_session session, ssh_message msg, void *data) | ssh_bind_message_callback, | ||
void * | data | ||
) |
defines the ssh_message callback
session | the current ssh session | |
[in] | ssh_bind_message_callback | a function pointer to a callback taking the current ssh session and received message as parameters. the function returns 0 if the message has been parsed and treated successfully, 1 otherwise (libssh must take care of the response). |
[in] | data | void pointer to be passed to callback functions |