diff options
author | rofl0r <retnyg@gmx.net> | 2012-01-02 16:31:37 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2012-01-02 16:31:37 +0100 |
commit | 2ffbdb0492d3ceae6943eff1a8fd39076808c175 (patch) | |
tree | f706957e63a0d435e80b006815c783c2498fde82 | |
parent | 4305da29a19446ccd2ab83c6b42cbd037fe377a3 (diff) | |
download | libssh-2ffbdb0492d3ceae6943eff1a8fd39076808c175.tar.gz libssh-2ffbdb0492d3ceae6943eff1a8fd39076808c175.tar.xz libssh-2ffbdb0492d3ceae6943eff1a8fd39076808c175.zip |
commit a7e14524c4f7903f607cdcd02b83782e89f0a82c
-rw-r--r-- | include/libssh/libssh.h | 1 | ||||
-rw-r--r-- | src/session.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 30e31de..815afc5 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 2160ffe..404b36b 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. |