summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Simons <jon@jonsimons.org>2013-12-02 17:16:12 -0800
committerAndreas Schneider <asn@cryptomilk.org>2013-12-07 16:24:33 +0100
commita1f0b2acfc7b2faac4bd1611f9100cee1c194d6d (patch)
tree7cf31a5e21f68a2c892e1e7da6aa125214489ea1
parentd65777b5705aff7b9af969c8210e3f6671dc105d (diff)
downloadlibssh-a1f0b2acfc7b2faac4bd1611f9100cee1c194d6d.tar.gz
libssh-a1f0b2acfc7b2faac4bd1611f9100cee1c194d6d.tar.xz
libssh-a1f0b2acfc7b2faac4bd1611f9100cee1c194d6d.zip
session: Add ssh_get_clientbanner().
-rw-r--r--include/libssh/libssh.h1
-rw-r--r--src/session.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 9a00ea7c..46aafae1 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -625,6 +625,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_clientbanner(ssh_session session);
LIBSSH_API const char* ssh_get_serverbanner(ssh_session session);
#ifndef LIBSSH_LEGACY_0_4
diff --git a/src/session.c b/src/session.c
index ebf48d8d..171779c5 100644
--- a/src/session.c
+++ b/src/session.c
@@ -280,6 +280,21 @@ void ssh_free(ssh_session session) {
}
/**
+ * @brief get the client banner
+ *
+ * @param[in] session The SSH session
+ *
+ * @return Returns the client banner string or NULL.
+ */
+const char* ssh_get_clientbanner(ssh_session session) {
+ if (session == NULL) {
+ return NULL;
+ }
+
+ return session->clientbanner;
+}
+
+/**
* @brief get the server banner
*
* @param[in] session The SSH session