1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

session: Add ssh_get_clientbanner().

This commit is contained in:
Jon Simons
2013-12-02 17:16:12 -08:00
committed by Andreas Schneider
parent d65777b570
commit a1f0b2acfc
2 changed files with 16 additions and 0 deletions

View File

@@ -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_fd(ssh_event event, socket_t fd);
LIBSSH_API int ssh_event_remove_session(ssh_event event, ssh_session session); LIBSSH_API int ssh_event_remove_session(ssh_event event, ssh_session session);
LIBSSH_API void ssh_event_free(ssh_event event); 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); LIBSSH_API const char* ssh_get_serverbanner(ssh_session session);
#ifndef LIBSSH_LEGACY_0_4 #ifndef LIBSSH_LEGACY_0_4

View File

@@ -279,6 +279,21 @@ void ssh_free(ssh_session session) {
SAFE_FREE(session); SAFE_FREE(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 * @brief get the server banner
* *