aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libssh/libssh.h1
-rw-r--r--src/session.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 30e31de4..815afc53 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -580,6 +580,7 @@ LIBSSH_API int ssh_event_dopoll(ssh_event event, int timeout);
LIBSSH_API int ssh_event_remove_fd(ssh_event event, socket_t fd);
LIBSSH_API int ssh_event_remove_session(ssh_event event, ssh_session session);
LIBSSH_API void ssh_event_free(ssh_event event);
+LIBSSH_API const char* ssh_get_serverbanner(ssh_session session);
#ifndef LIBSSH_LEGACY_0_4
#include "libssh/legacy.h"
diff --git a/src/session.c b/src/session.c
index 2160ffea..404b36b0 100644
--- a/src/session.c
+++ b/src/session.c
@@ -246,6 +246,17 @@ void ssh_free(ssh_session session) {
}
/**
+ * @brief get the server banner
+ * @param[in] session The SSH session
+ */
+const char* ssh_get_serverbanner(ssh_session session) {
+ if(!session) {
+ return NULL;
+ }
+ return session->serverbanner;
+}
+
+/**
* @brief Disconnect impolitely from a remote host by closing the socket.
*
* Suitable if you forked and want to destroy this session.