diff --git a/include/libssh/server.h b/include/libssh/server.h index 477f9d7e..9b11d113 100644 --- a/include/libssh/server.h +++ b/include/libssh/server.h @@ -21,6 +21,12 @@ * vim: ts=2 sw=2 et cindent */ +/** + * @defgroup ssh_server SSH Server + * @addtogroup ssh_server + * @{ + */ + #ifndef SERVER_H #define SERVER_H @@ -37,7 +43,8 @@ SSH_BIND *ssh_bind_new(void); void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options); int ssh_bind_listen(SSH_BIND *ssh_bind); void ssh_bind_set_blocking(SSH_BIND *ssh_bind,int blocking); -int ssh_bind_get_fd(SSH_BIND *ssh_bind); +socket_t ssh_bind_get_fd(SSH_BIND *ssh_bind); +void ssh_bind_set_fd(SSH_BIND *ssh_bind, socket_t fd); void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind); SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind); void ssh_bind_free(SSH_BIND *ssh_bind); @@ -95,3 +102,7 @@ int ssh_message_channel_request_reply_success(SSH_MESSAGE *msg); #endif /* __cplusplus */ #endif /* SERVER_H */ + +/** + * @} + */ diff --git a/libssh/server.c b/libssh/server.c index 9473c9a2..9cc59ef7 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -167,10 +167,14 @@ void ssh_bind_set_blocking(SSH_BIND *ssh_bind, int blocking) { ssh_bind->blocking = blocking ? 1 : 0; } -int ssh_bind_get_fd(SSH_BIND *ssh_bind) { +socket_t ssh_bind_get_fd(SSH_BIND *ssh_bind) { return ssh_bind->bindfd; } +void ssh_bind_set_fd(SSH_BIND *ssh_bind, socket_t fd) { + ssh_bind->bindfd = fd; +} + void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind) { ssh_bind->toaccept = 1; }