1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-05 20:55:46 +03:00

Defined SSH server callbacks interface

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Aris Adamantiadis
2013-02-11 21:31:11 +01:00
committed by Andreas Schneider
parent 48b715cce0
commit ab2e641b4a
3 changed files with 124 additions and 1 deletions

View File

@@ -59,3 +59,19 @@ int ssh_set_channel_callbacks(ssh_channel channel, ssh_channel_callbacks cb) {
leave_function();
return 0;
}
int ssh_set_server_callbacks(ssh_session session, ssh_server_callbacks cb){
if (session == NULL || cb == NULL) {
return SSH_ERROR;
}
enter_function();
if(cb->size <= 0 || cb->size > 1024 * sizeof(void *)){
ssh_set_error(session,SSH_FATAL,
"Invalid callback passed in (badly initialized)");
leave_function();
return SSH_ERROR;
}
session->server_callbacks = cb;
leave_function();
return 0;
}