SSH Server


Functions

int ssh_accept (SSH_SESSION *session)
 Exchange the banner and cryptographic keys.
SSH_SESSION * ssh_bind_accept (SSH_BIND *ssh_bind)
 Accept an incoming ssh connection and initialize the session.
void ssh_bind_fd_toaccept (SSH_BIND *ssh_bind)
 Allow the file descriptor to accept new sessions.
void ssh_bind_free (SSH_BIND *ssh_bind)
 Free a ssh servers bind.
socket_t ssh_bind_get_fd (SSH_BIND *ssh_bind)
 Recover the file descriptor from the session.
int ssh_bind_listen (SSH_BIND *ssh_bind)
 Start listening to the socket.
SSH_BIND * ssh_bind_new (void)
 Creates a new SSH server bind.
void ssh_bind_set_blocking (SSH_BIND *ssh_bind, int blocking)
 Set the session to blocking/nonblocking mode.
void ssh_bind_set_fd (SSH_BIND *ssh_bind, socket_t fd)
 Set the file descriptor for a session.
void ssh_bind_set_options (SSH_BIND *ssh_bind, SSH_OPTIONS *options)
 Set the opitons for the current SSH server bind.

Function Documentation

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.

SSH_SESSION * ssh_bind_accept ( SSH_BIND *  ssh_bind  ) 

Accept an incoming ssh connection and initialize the session.

Parameters:
ssh_bind The ssh server bind to accept a connection.
Returns:
A newly allocated ssh session, NULL on error.

References privatekey_free(), ssh_new(), and ssh_options_copy().

void ssh_bind_fd_toaccept ( SSH_BIND *  ssh_bind  ) 

Allow the file descriptor to accept new sessions.

Parameters:
ssh_bind The ssh server bind to use.

void ssh_bind_free ( SSH_BIND *  ssh_bind  ) 

Free a ssh servers bind.

Parameters:
ssh_bind The ssh server bind to free.

References ssh_options_free().

socket_t ssh_bind_get_fd ( SSH_BIND *  ssh_bind  ) 

Recover the file descriptor from the session.

Parameters:
ssh_bind The ssh server bind to get the fd from.
Returns:
The file descriptor.

int ssh_bind_listen ( SSH_BIND *  ssh_bind  ) 

Start listening to the socket.

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

void ssh_bind_set_blocking ( SSH_BIND *  ssh_bind,
int  blocking 
)

Set the session to blocking/nonblocking mode.

Parameters:
ssh_bind The ssh server bind to use.
blocking Zero for nonblocking mode.

void ssh_bind_set_fd ( SSH_BIND *  ssh_bind,
socket_t  fd 
)

Set the file descriptor for a session.

Parameters:
ssh_bind The ssh server bind to set the fd.
fd The file descriptor.

void ssh_bind_set_options ( SSH_BIND *  ssh_bind,
SSH_OPTIONS *  options 
)

Set the opitons for the current SSH server bind.

Parameters:
ssh_bind The ssh server bind to use.
options The option structure to set.


doxygen