diff options
author | Mike Harris <harmic@gmail.com> | 2021-02-02 03:58:47 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 16:58:47 +0000 |
commit | 459296d0e21fbbfd77a60a8341194e5c39a66d6f (patch) | |
tree | 8e80ceedede29c28af819fe18bb2a2e15879c657 /libssh2-sys/lib.rs | |
parent | 1fcf8d38d401b230561863d1e40fd41d76e8601c (diff) | |
download | ssh2-rs-459296d0e21fbbfd77a60a8341194e5c39a66d6f.zip |
Expose libssh2_trace function (#209)
* Expose libssh2_trace function and associated
constants, to allow enabling libssh2 trace
output.
* set LIBSSH2_WIN32 on windows build so that
gettimeofday replacement will be compiled.
* libssh2_trace actually returns int, even though
the documentation says it returns void. This
was causing systest to fail.
Changed the FFI to match the C function.
Co-authored-by: eharmic <michael.harris@ericsson.com>
Diffstat (limited to 'libssh2-sys/lib.rs')
-rw-r--r-- | libssh2-sys/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libssh2-sys/lib.rs b/libssh2-sys/lib.rs index ad36642..8186fd7 100644 --- a/libssh2-sys/lib.rs +++ b/libssh2-sys/lib.rs @@ -188,6 +188,15 @@ pub const LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE: c_int = 2; pub const LIBSSH2_SESSION_BLOCK_INBOUND: c_int = 1; pub const LIBSSH2_SESSION_BLOCK_OUTBOUND: c_int = 2; +pub const LIBSSH2_TRACE_TRANS : c_int = 1<<1; +pub const LIBSSH2_TRACE_KEX : c_int = 1<<2; +pub const LIBSSH2_TRACE_AUTH : c_int = 1<<3; +pub const LIBSSH2_TRACE_CONN : c_int = 1<<4; +pub const LIBSSH2_TRACE_SCP : c_int = 1<<5; +pub const LIBSSH2_TRACE_SFTP : c_int = 1<<6; +pub const LIBSSH2_TRACE_ERROR : c_int = 1<<7; +pub const LIBSSH2_TRACE_PUBLICKEY : c_int = 1<<8; +pub const LIBSSH2_TRACE_SOCKET : c_int = 1<<9; pub enum LIBSSH2_SESSION {} pub enum LIBSSH2_AGENT {} pub enum LIBSSH2_CHANNEL {} @@ -310,6 +319,7 @@ extern "C" { pub fn libssh2_exit(); pub fn libssh2_free(sess: *mut LIBSSH2_SESSION, ptr: *mut c_void); pub fn libssh2_hostkey_hash(session: *mut LIBSSH2_SESSION, hash_type: c_int) -> *const c_char; + pub fn libssh2_trace(session: *mut LIBSSH2_SESSION, bitmask: c_int) -> c_int; // session pub fn libssh2_session_init_ex( |