SSH Server

Functions

LIBSSH_API int channel_write_stderr (ssh_channel channel, const void *data, uint32_t len)
 Blocking write on channel for stderr.
LIBSSH_API int ssh_accept (ssh_session session)
 Exchange the banner and cryptographic keys.
LIBSSH_API int ssh_bind_accept (ssh_bind ssh_bind_o, ssh_session session)
 Accept an incoming ssh connection and initialize the session.
LIBSSH_API void ssh_bind_fd_toaccept (ssh_bind ssh_bind_o)
 Allow the file descriptor to accept new sessions.
LIBSSH_API void ssh_bind_free (ssh_bind ssh_bind_o)
 Free a ssh servers bind.
LIBSSH_API socket_t ssh_bind_get_fd (ssh_bind ssh_bind_o)
 Recover the file descriptor from the session.
LIBSSH_API int ssh_bind_listen (ssh_bind ssh_bind_o)
 Start listening to the socket.
LIBSSH_API 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 opitons for the current SSH server bind.
LIBSSH_API void ssh_bind_set_blocking (ssh_bind ssh_bind_o, int blocking)
 Set the session to blocking/nonblocking mode.
LIBSSH_API void ssh_bind_set_fd (ssh_bind ssh_bind_o, socket_t fd)
 Set the file descriptor for a session.
LIBSSH_API void ssh_set_message_callback (ssh_session session, int(*ssh_message_callback)(ssh_session session, ssh_message msg))
 defines the SSH_MESSAGE callback

Function Documentation

int channel_write_stderr ( ssh_channel  channel,
const void *  data,
uint32_t  len 
)

Blocking write on channel for stderr.

Parameters:
channel The channel to write to.
data A pointer to the data to write.
len The length of the buffer to write to.
Returns:
The number of bytes written, SSH_ERROR on error.
See also:
channel_read()
int ssh_accept ( ssh_session  session  ) 

Exchange the banner and cryptographic keys.

Parameters:
session The ssh session to accept a connection.
Returns:
0 on success, < 0 on error.
int ssh_bind_accept ( ssh_bind  ssh_bind_o,
ssh_session  session 
)

Accept an incoming ssh connection and initialize the session.

Parameters:
ssh_bind_o The ssh server bind to accept a connection.
session A preallocated ssh session
See also:
ssh_new
Returns:
A newly allocated ssh session, NULL on error.

References privatekey_free().

void ssh_bind_fd_toaccept ( ssh_bind  ssh_bind_o  ) 

Allow the file descriptor to accept new sessions.

Parameters:
ssh_bind_o The ssh server bind to use.
void ssh_bind_free ( ssh_bind  ssh_bind_o  ) 

Free a ssh servers bind.

Parameters:
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.

Parameters:
ssh_bind_o The ssh server bind to get the fd from.
Returns:
The file descriptor.
int ssh_bind_listen ( ssh_bind  ssh_bind_o  ) 

Start listening to the socket.

Parameters:
ssh_bind_o The ssh server bind to use.
Returns:
0 on success, < 0 on error.

References ssh_init().

ssh_bind ssh_bind_new ( void   ) 

Creates a new SSH server bind.

Returns:
A newly allocated ssh_bind session pointer.
LIBSSH_API int ssh_bind_options_set ( ssh_bind  sshbind,
enum ssh_bind_options_e  type,
const void *  value 
)

Set the opitons for the current SSH server bind.

Parameters:
ssh_bind The ssh server bind to use.
options The option structure to set.
void ssh_bind_set_blocking ( ssh_bind  ssh_bind_o,
int  blocking 
)

Set the session to blocking/nonblocking mode.

Parameters:
ssh_bind_o The ssh server bind to use.
blocking Zero for nonblocking mode.
void ssh_bind_set_fd ( ssh_bind  ssh_bind_o,
socket_t  fd 
)

Set the file descriptor for a session.

Parameters:
ssh_bind_o The ssh server bind to set the fd.
fd The file descriptssh_bind B
void ssh_set_message_callback ( ssh_session  session,
int(*)(ssh_session session, ssh_message msg)  ssh_message_callback 
)

defines the SSH_MESSAGE callback

Parameters:
session the current ssh session
ssh_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 sucessfuly, 1 otherwise (libssh must take care of the response).
Generated on Mon Jul 5 22:11:15 2010 for libssh by  doxygen 1.6.3