1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-23 01:22:37 +03:00

new function: libssh2_session_banner_get

Returns the banner from the server handshake

Fixes #226
This commit is contained in:
Daniel Stenberg
2011-09-09 22:59:26 +02:00
parent a6ebc6f9fd
commit f2c21f6f84
4 changed files with 37 additions and 0 deletions

View File

@@ -1718,3 +1718,19 @@ libssh2_session_block_directions(LIBSSH2_SESSION *session)
return session->socket_block_directions;
}
/* libssh2_session_banner_get
* Get the remote banner (server ID string)
*/
LIBSSH2_API const char *
libssh2_session_banner_get(LIBSSH2_SESSION *session)
{
/* to avoid a coredump when session is NULL */
if (NULL == session)
return NULL;
if (NULL==session->remote.banner)
return NULL;
return (const char *) session->remote.banner;
}