diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-10-10 23:04:06 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-05-02 16:58:47 +0200 |
commit | 9b3648ded00b05412e63a3260c7baf605d03e75f (patch) | |
tree | 429abf2d7c1d72d181a2c45b93c685729b01c36a /include | |
parent | 0701745cbcebd8a378814b5f61cbfa1723465fb6 (diff) | |
download | libssh-9b3648ded00b05412e63a3260c7baf605d03e75f.tar.gz libssh-9b3648ded00b05412e63a3260c7baf605d03e75f.tar.xz libssh-9b3648ded00b05412e63a3260c7baf605d03e75f.zip |
connector: Implement ssh_connector_except()
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/libssh.h | 24 | ||||
-rw-r--r-- | include/libssh/priv.h | 4 |
2 files changed, 28 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index e384ba04..5b4d4efa 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -123,6 +123,7 @@ typedef struct ssh_scp_struct* ssh_scp; typedef struct ssh_session_struct* ssh_session; typedef struct ssh_string_struct* ssh_string; typedef struct ssh_event_struct* ssh_event; +typedef struct ssh_connector_struct * ssh_connector; typedef void* ssh_gssapi_creds; /* Socket type */ @@ -373,6 +374,15 @@ enum ssh_scp_request_types { SSH_SCP_REQUEST_WARNING }; +enum ssh_connector_flags_e { + /** Only the standard stream of the channel */ + SSH_CONNECTOR_STDOUT = 1, + /** Only the exception stream of the channel */ + SSH_CONNECTOR_STDERR = 2, + /** Merge both standard and exception streams */ + SSH_CONNECTOR_BOTH = 3 +}; + LIBSSH_API int ssh_blocking_flush(ssh_session session, int timeout); LIBSSH_API ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms); LIBSSH_API int ssh_channel_change_pty_size(ssh_channel channel,int cols,int rows); @@ -422,6 +432,18 @@ LIBSSH_API uint32_t ssh_channel_window_size(ssh_channel channel); LIBSSH_API char *ssh_basename (const char *path); LIBSSH_API void ssh_clean_pubkey_hash(unsigned char **hash); LIBSSH_API int ssh_connect(ssh_session session); + +LIBSSH_API ssh_connector ssh_connector_new(ssh_session session); +LIBSSH_API void ssh_connector_free(ssh_connector connector); +LIBSSH_API int ssh_connector_set_in_channel(ssh_connector connector, + ssh_channel channel, + enum ssh_connector_flags_e flags); +LIBSSH_API int ssh_connector_set_out_channel(ssh_connector connector, + ssh_channel channel, + enum ssh_connector_flags_e flags); +LIBSSH_API void ssh_connector_set_in_fd(ssh_connector connector, socket_t fd); +LIBSSH_API void ssh_connector_set_out_fd(ssh_connector connector, socket_t fd); + LIBSSH_API const char *ssh_copyright(void); LIBSSH_API void ssh_disconnect(ssh_session session); LIBSSH_API char *ssh_dirname (const char *path); @@ -672,9 +694,11 @@ LIBSSH_API ssh_event ssh_event_new(void); LIBSSH_API int ssh_event_add_fd(ssh_event event, socket_t fd, short events, ssh_event_callback cb, void *userdata); LIBSSH_API int ssh_event_add_session(ssh_event event, ssh_session session); +LIBSSH_API int ssh_event_add_connector(ssh_event event, ssh_connector connector); 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 int ssh_event_remove_connector(ssh_event event, ssh_connector connector); 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); diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 9b34b247..a4e08cac 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -259,6 +259,10 @@ int decompress_buffer(ssh_session session,ssh_buffer buf, size_t maxlen); /* match.c */ int match_hostname(const char *host, const char *pattern, unsigned int len); +/* connector.c */ +int ssh_connector_set_event(ssh_connector connector, ssh_event event); +int ssh_connector_remove_event(ssh_connector connector); + #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif |