aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-11 10:24:37 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-11 10:24:37 +0000
commit1657d0932f463346911118574b4a22244f75b546 (patch)
tree9989bbb0504278e747e28480d737dbae560eaf45
parentf0432cc24f08c95f0213da28e4eb150bfc65338e (diff)
downloadlibssh-1657d0932f463346911118574b4a22244f75b546.tar.gz
libssh-1657d0932f463346911118574b4a22244f75b546.tar.xz
libssh-1657d0932f463346911118574b4a22244f75b546.zip
Document the ssh server bind functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@756 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r--include/libssh/server.h75
1 files changed, 74 insertions, 1 deletions
diff --git a/include/libssh/server.h b/include/libssh/server.h
index 9b11d113..dac318c9 100644
--- a/include/libssh/server.h
+++ b/include/libssh/server.h
@@ -39,15 +39,88 @@ extern "C" {
typedef struct ssh_bind_struct SSH_BIND;
+/**
+ * @brief Creates a new SSH server bind.
+ *
+ * @return A newly allocated ssh_bind session pointer.
+ */
SSH_BIND *ssh_bind_new(void);
+
+/**
+ * @brief Set the opitons for the current SSH server bind.
+ *
+ * @param ssh_bind The ssh server bind to use.
+ *
+ * @param options The option structure to set.
+ */
void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options);
+
+/**
+ * @brief Start listening to the socket.
+ *
+ * @param ssh_bind The ssh server bind to use.
+ *
+ * @return 0 on success, < 0 on error.
+ */
int ssh_bind_listen(SSH_BIND *ssh_bind);
-void ssh_bind_set_blocking(SSH_BIND *ssh_bind,int blocking);
+
+/**
+ * @brief Set the session to blocking/nonblocking mode.
+ *
+ * @param ssh_bind The ssh server bind to use.
+ *
+ * @param blocking Zero for nonblocking mode.
+ */
+void ssh_bind_set_blocking(SSH_BIND *ssh_bind, int blocking);
+
+/**
+ * @brief Recover the file descriptor from the session.
+ *
+ * @param ssh_bind The ssh server bind to get the fd from.
+ *
+ * @return The file descriptor.
+ */
socket_t ssh_bind_get_fd(SSH_BIND *ssh_bind);
+
+/**
+ * @brief Set the file descriptor for a session.
+ *
+ * @param ssh_bind The ssh server bind to set the fd.
+ *
+ * @param fd The file descriptor.
+ */
void ssh_bind_set_fd(SSH_BIND *ssh_bind, socket_t fd);
+
+/**
+ * @brief Allow the file descriptor to accept new sessions.
+ *
+ * @param ssh_bind The ssh server bind to use.
+ */
void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind);
+
+/**
+ * @brief Accept an incoming ssh connection and initialize the session.
+ *
+ * @param ssh_bind The ssh server bind to accept a connection.
+ *
+ * @return A newly allocated ssh session, NULL on error.
+ */
SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind);
+
+/**
+ * @brief Free a ssh servers bind.
+ *
+ * @param ssh_bind The ssh server bind to free.
+ */
void ssh_bind_free(SSH_BIND *ssh_bind);
+
+/**
+ * @brief Exchange the banner and cryptographic keys.
+ *
+ * @param session The ssh session to accept a connection.
+ *
+ * @return 0 on success, < 0 on error.
+ */
int ssh_accept(SSH_SESSION *session);
/* messages.c */