示例#1
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
        public unsafe static SshKeyHandle?ssh_get_server_publickey(SessionHandle session)
        {
            IntPtr pkey;
            int    rv = ssh_get_server_publickey(session, &pkey);

            return(rv == SSH_OK ? new SshKeyHandle(pkey, ownsHandle: true) : null);
        }
示例#2
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public unsafe static bool ssh_options_set(SessionHandle session, SshOption option, string value)
 {
     // TODO: stackalloc
     fixed(byte *p = Encoding.UTF8.GetBytes(value))
     {
         return(ssh_options_set(session, option, new IntPtr(p)) == 0);
     }
 }
示例#3
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static IntPtr ssh_get_fd(SessionHandle session)
 {
     if (Platform.IsWindows)
     {
         return(ssh_get_fd_windows(session));
     }
     else
     {
         return(new IntPtr(ssh_get_fd_unix(session)));
     }
 }
示例#4
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern int ssh_options_set(SessionHandle session, SshOption option, IntPtr value);
示例#5
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern AuthResult ssh_userauth_publickey(SessionHandle session, string?username, SshKeyHandle privkey);
示例#6
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern PollFlags ssh_get_poll_flags(SessionHandle session);
示例#7
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static bool ssh_get_error_is_fatal(SessionHandle session)
 => ssh_get_error_code(session) == SSH_FATAL;
示例#8
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static string ssh_get_error(SessionHandle session)
 {
     return(Marshal.PtrToStringAnsi(ssh_get_error_(session)) ?? "Uknown error.");
 }
示例#9
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern AuthResult ssh_userauth_password(SessionHandle session, string username, string password);
示例#10
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern KnownHostResult ssh_session_is_known_server(SessionHandle session);
示例#11
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern AuthResult ssh_userauth_publickey_auto(SessionHandle session, string?username, string?passphrase);
示例#12
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern int ssh_event_remove_session(EventHandle @event, SessionHandle session);
示例#13
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern int ssh_blocking_flush(SessionHandle session, int timeout);
示例#14
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 private static extern int ssh_get_fd_unix(SessionHandle session);
示例#15
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 private static extern IntPtr ssh_get_fd_windows(SessionHandle session);
示例#16
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public unsafe static bool ssh_options_set(SessionHandle session, SshOption option, uint value)
 {
     return(ssh_options_set(session, option, new IntPtr(&value)) == 0);
 }
示例#17
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern int ssh_disconnect(SessionHandle session);
示例#18
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 private static extern int ssh_is_connected_(SessionHandle session);
示例#19
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern IntPtr ssh_get_error_(SessionHandle session);
示例#20
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static bool ssh_is_connected(SessionHandle session)
 {
     return(ssh_is_connected_(session) == 1);
 }
示例#21
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern int ssh_get_error_code(SessionHandle session);
示例#22
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 private static unsafe extern int ssh_get_server_publickey(SessionHandle session, IntPtr *pkey);
示例#23
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern ChannelHandle ssh_channel_new(SessionHandle session);
示例#24
0
文件: Interop.cs 项目: tmds/Tmds.Ssh
 public static extern void ssh_set_blocking(SessionHandle session, int blocking);