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:
committed by
Andreas Schneider
parent
48b715cce0
commit
ab2e641b4a
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user