#![allow(missing_copy_implementations)]
#![allow(non_camel_case_types)]
extern crate libc;
use std::mem;
extern "C" {
pub fn ssh_blocking_flush(session: *mut ssh_session_struct, timeout: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_accept_x11(channel: *mut ssh_channel_struct, timeout_ms: libc::c_int) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn ssh_channel_change_pty_size(channel: *mut ssh_channel_struct, cols: libc::c_int, rows: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_close(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_free(channel: *mut ssh_channel_struct);
}
extern "C" {
pub fn ssh_channel_get_exit_status(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_get_session(channel: *mut ssh_channel_struct) -> *mut ssh_session_struct;
}
extern "C" {
pub fn ssh_channel_is_closed(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_is_eof(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_is_open(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_new(session: *mut ssh_session_struct) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn ssh_channel_open_auth_agent(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_open_forward(channel: *mut ssh_channel_struct, remotehost: *const libc::c_char, remoteport: libc::c_int, sourcehost: *const libc::c_char, localport: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_open_session(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_open_x11(channel: *mut ssh_channel_struct, orig_addr: *const libc::c_char, orig_port: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_poll(channel: *mut ssh_channel_struct, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_poll_timeout(channel: *mut ssh_channel_struct, timeout: libc::c_int, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_read(channel: *mut ssh_channel_struct, dest: *mut libc::c_void, count: libc::c_uint, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_read_timeout(channel: *mut ssh_channel_struct, dest: *mut libc::c_void, count: libc::c_uint, is_stderr: libc::c_int, timeout_ms: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_read_nonblocking(channel: *mut ssh_channel_struct, dest: *mut libc::c_void, count: libc::c_uint, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_env(channel: *mut ssh_channel_struct, name: *const libc::c_char, value: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_exec(channel: *mut ssh_channel_struct, cmd: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_pty(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_pty_size(channel: *mut ssh_channel_struct, term: *const libc::c_char, cols: libc::c_int, rows: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_shell(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_send_signal(channel: *mut ssh_channel_struct, signum: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_sftp(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_subsystem(channel: *mut ssh_channel_struct, subsystem: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_x11(channel: *mut ssh_channel_struct, single_connection: libc::c_int, protocol: *const libc::c_char, cookie: *const libc::c_char, screen_number: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_send_eof(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_select(readchans: *mut *mut ssh_channel_struct, writechans: *mut *mut ssh_channel_struct, exceptchans: *mut *mut ssh_channel_struct, timeout: *mut timeval) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_set_blocking(channel: *mut ssh_channel_struct, blocking: libc::c_int);
}
extern "C" {
pub fn ssh_channel_write(channel: *mut ssh_channel_struct, data: *const libc::c_void, len: libc::c_uint) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_window_size(channel: *mut ssh_channel_struct) -> libc::c_uint;
}
extern "C" {
pub fn ssh_basename(path: *const libc::c_char) -> *mut libc::c_char;
}
extern "C" {
pub fn ssh_clean_pubkey_hash(hash: *mut *mut libc::c_uchar);
}
extern "C" {
pub fn ssh_connect(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_copyright() -> *const libc::c_char;
}
extern "C" {
pub fn ssh_disconnect(session: *mut ssh_session_struct);
}
extern "C" {
pub fn ssh_dirname(path: *const libc::c_char) -> *mut libc::c_char;
}
extern "C" {
pub fn ssh_finalize() -> libc::c_int;
}
extern "C" {
pub fn ssh_forward_accept(session: *mut ssh_session_struct, timeout_ms: libc::c_int) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn ssh_channel_accept_forward(session: *mut ssh_session_struct, timeout_ms: libc::c_int, destination_port: *mut libc::c_int) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn ssh_forward_cancel(session: *mut ssh_session_struct, address: *const libc::c_char, port: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_forward_listen(session: *mut ssh_session_struct, address: *const libc::c_char, port: libc::c_int, bound_port: *mut libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_free(session: *mut ssh_session_struct);
}
extern "C" {
pub fn ssh_get_disconnect_message(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_get_error(error: *mut libc::c_void) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_get_error_code(error: *mut libc::c_void) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_fd(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_hexa(what: *const libc::c_uchar, len: libc::c_ulong) -> *mut libc::c_char;
}
extern "C" {
pub fn ssh_get_issue_banner(session: *mut ssh_session_struct) -> *mut libc::c_char;
}
extern "C" {
pub fn ssh_get_openssh_version(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_publickey(session: *mut ssh_session_struct, key: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_publickey_hash(key: *mut ssh_key_struct, type_: libc::c_uint, hash: *mut *mut libc::c_uchar, hlen: *mut libc::c_ulong) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_pubkey_hash(session: *mut ssh_session_struct, hash: *mut *mut libc::c_uchar) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_random(where_: *mut libc::c_void, len: libc::c_int, strong: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_version(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_status(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_poll_flags(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_init() -> libc::c_int;
}
extern "C" {
pub fn ssh_is_blocking(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_is_connected(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_is_server_known(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_set_log_level(level: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_get_log_level() -> libc::c_int;
}
extern "C" {
pub fn ssh_get_log_userdata() -> *mut libc::c_void;
}
extern "C" {
pub fn ssh_set_log_userdata(data: *mut libc::c_void) -> libc::c_int;
}
extern "C" {
pub fn _ssh_log(verbosity: libc::c_int, function: *const libc::c_char, format: *const libc::c_char);
}
extern "C" {
pub fn ssh_log(session: *mut ssh_session_struct, prioriry: libc::c_int, format: *const libc::c_char);
}
extern "C" {
pub fn ssh_message_channel_request_open_reply_accept(msg: *mut ssh_message_struct) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn ssh_message_channel_request_reply_success(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_free(msg: *mut ssh_message_struct);
}
extern "C" {
pub fn ssh_message_get(session: *mut ssh_session_struct) -> *mut ssh_message_struct;
}
extern "C" {
pub fn ssh_message_subtype(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_type(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_mkdir(pathname: *const libc::c_char, mode: libc::c_uint) -> libc::c_int;
}
extern "C" {
pub fn ssh_new() -> *mut ssh_session_struct;
}
extern "C" {
pub fn ssh_options_copy(src: *mut ssh_session_struct, dest: *mut *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_options_getopt(session: *mut ssh_session_struct, argcptr: *mut libc::c_int, argv: *mut *mut libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_options_parse_config(session: *mut ssh_session_struct, filename: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_options_set(session: *mut ssh_session_struct, type_: libc::c_uint, value: *const libc::c_void) -> libc::c_int;
}
extern "C" {
pub fn ssh_options_get(session: *mut ssh_session_struct, type_: libc::c_uint, value: *mut *mut libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_options_get_port(session: *mut ssh_session_struct, port_target: *mut libc::c_uint) -> libc::c_int;
}
extern "C" {
pub fn ssh_pcap_file_close(pcap: *mut ssh_pcap_file_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pcap_file_free(pcap: *mut ssh_pcap_file_struct);
}
extern "C" {
pub fn ssh_pcap_file_new() -> *mut ssh_pcap_file_struct;
}
extern "C" {
pub fn ssh_pcap_file_open(pcap: *mut ssh_pcap_file_struct, filename: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_key_new() -> *mut ssh_key_struct;
}
extern "C" {
pub fn ssh_key_free(key: *mut ssh_key_struct);
}
extern "C" {
pub fn ssh_key_type(key: *mut ssh_key_struct) -> libc::c_uint;
}
extern "C" {
pub fn ssh_key_type_to_char(type_: libc::c_uint) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_key_type_from_name(name: *const libc::c_char) -> libc::c_uint;
}
extern "C" {
pub fn ssh_key_is_public(k: *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_key_is_private(k: *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_key_cmp(k1: *mut ssh_key_struct, k2: *mut ssh_key_struct, what: libc::c_uint) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_generate(type_: libc::c_uint, parameter: libc::c_int, pkey: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_import_privkey_base64(b64_key: *const libc::c_char, passphrase: *const libc::c_char, auth_fn: Option<extern fn(*const libc::c_char, *mut libc::c_char, libc::c_ulong, libc::c_int, libc::c_int, *mut libc::c_void) -> libc::c_int>, auth_data: *mut libc::c_void, pkey: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_import_privkey_file(filename: *const libc::c_char, passphrase: *const libc::c_char, auth_fn: Option<extern fn(*const libc::c_char, *mut libc::c_char, libc::c_ulong, libc::c_int, libc::c_int, *mut libc::c_void) -> libc::c_int>, auth_data: *mut libc::c_void, pkey: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_export_privkey_file(privkey: *mut ssh_key_struct, passphrase: *const libc::c_char, auth_fn: Option<extern fn(*const libc::c_char, *mut libc::c_char, libc::c_ulong, libc::c_int, libc::c_int, *mut libc::c_void) -> libc::c_int>, auth_data: *mut libc::c_void, filename: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_import_pubkey_base64(b64_key: *const libc::c_char, type_: libc::c_uint, pkey: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_import_pubkey_file(filename: *const libc::c_char, pkey: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_export_privkey_to_pubkey(privkey: *mut ssh_key_struct, pkey: *mut *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_export_pubkey_base64(key: *mut ssh_key_struct, b64_key: *mut *mut libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_pki_export_pubkey_file(key: *mut ssh_key_struct, filename: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_print_hexa(descr: *const libc::c_char, what: *const libc::c_uchar, len: libc::c_ulong);
}
extern "C" {
pub fn ssh_send_ignore(session: *mut ssh_session_struct, data: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_send_debug(session: *mut ssh_session_struct, message: *const libc::c_char, always_display: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_gssapi_set_creds(session: *mut ssh_session_struct, creds: *mut libc::c_void);
}
extern "C" {
pub fn ssh_scp_accept_request(scp: *mut ssh_scp_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_close(scp: *mut ssh_scp_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_deny_request(scp: *mut ssh_scp_struct, reason: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_free(scp: *mut ssh_scp_struct);
}
extern "C" {
pub fn ssh_scp_init(scp: *mut ssh_scp_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_leave_directory(scp: *mut ssh_scp_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_new(session: *mut ssh_session_struct, mode: libc::c_int, location: *const libc::c_char) -> *mut ssh_scp_struct;
}
extern "C" {
pub fn ssh_scp_pull_request(scp: *mut ssh_scp_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_push_directory(scp: *mut ssh_scp_struct, dirname: *const libc::c_char, mode: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_push_file(scp: *mut ssh_scp_struct, filename: *const libc::c_char, size: libc::c_ulong, perms: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_push_file64(scp: *mut ssh_scp_struct, filename: *const libc::c_char, size: libc::c_ulong, perms: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_read(scp: *mut ssh_scp_struct, buffer: *mut libc::c_void, size: libc::c_ulong) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_request_get_filename(scp: *mut ssh_scp_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_scp_request_get_permissions(scp: *mut ssh_scp_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_scp_request_get_size(scp: *mut ssh_scp_struct) -> libc::c_ulong;
}
extern "C" {
pub fn ssh_scp_request_get_size64(scp: *mut ssh_scp_struct) -> libc::c_ulong;
}
extern "C" {
pub fn ssh_scp_request_get_warning(scp: *mut ssh_scp_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_scp_write(scp: *mut ssh_scp_struct, buffer: *const libc::c_void, len: libc::c_ulong) -> libc::c_int;
}
extern "C" {
pub fn ssh_select(channels: *mut *mut ssh_channel_struct, outchannels: *mut *mut ssh_channel_struct, maxfd: libc::c_int, readfds: *mut fd_set, timeout: *mut timeval) -> libc::c_int;
}
extern "C" {
pub fn ssh_service_request(session: *mut ssh_session_struct, service: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_set_agent_channel(session: *mut ssh_session_struct, channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_set_blocking(session: *mut ssh_session_struct, blocking: libc::c_int);
}
extern "C" {
pub fn ssh_set_fd_except(session: *mut ssh_session_struct);
}
extern "C" {
pub fn ssh_set_fd_toread(session: *mut ssh_session_struct);
}
extern "C" {
pub fn ssh_set_fd_towrite(session: *mut ssh_session_struct);
}
extern "C" {
pub fn ssh_silent_disconnect(session: *mut ssh_session_struct);
}
extern "C" {
pub fn ssh_set_pcap_file(session: *mut ssh_session_struct, pcapfile: *mut ssh_pcap_file_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_none(session: *mut ssh_session_struct, username: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_list(session: *mut ssh_session_struct, username: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_try_publickey(session: *mut ssh_session_struct, username: *const libc::c_char, pubkey: *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_publickey(session: *mut ssh_session_struct, username: *const libc::c_char, privkey: *mut ssh_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_agent(session: *mut ssh_session_struct, username: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_publickey_auto(session: *mut ssh_session_struct, username: *const libc::c_char, passphrase: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_password(session: *mut ssh_session_struct, username: *const libc::c_char, password: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_kbdint(session: *mut ssh_session_struct, user: *const libc::c_char, submethods: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_kbdint_getinstruction(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_userauth_kbdint_getname(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_userauth_kbdint_getnprompts(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_kbdint_getprompt(session: *mut ssh_session_struct, i: libc::c_uint, echo: *mut libc::c_char) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_userauth_kbdint_getnanswers(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_kbdint_getanswer(session: *mut ssh_session_struct, i: libc::c_uint) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_userauth_kbdint_setanswer(session: *mut ssh_session_struct, i: libc::c_uint, answer: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_gssapi(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_version(req_version: libc::c_int) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_write_knownhost(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_string_burn(str: *mut ssh_string_struct);
}
extern "C" {
pub fn ssh_string_copy(str: *mut ssh_string_struct) -> *mut ssh_string_struct;
}
extern "C" {
pub fn ssh_string_data(str: *mut ssh_string_struct) -> *mut libc::c_void;
}
extern "C" {
pub fn ssh_string_fill(str: *mut ssh_string_struct, data: *const libc::c_void, len: libc::c_ulong) -> libc::c_int;
}
extern "C" {
pub fn ssh_string_free(str: *mut ssh_string_struct);
}
extern "C" {
pub fn ssh_string_from_char(what: *const libc::c_char) -> *mut ssh_string_struct;
}
extern "C" {
pub fn ssh_string_len(str: *mut ssh_string_struct) -> libc::c_ulong;
}
extern "C" {
pub fn ssh_string_new(size: libc::c_ulong) -> *mut ssh_string_struct;
}
extern "C" {
pub fn ssh_string_get_char(str: *mut ssh_string_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_string_to_char(str: *mut ssh_string_struct) -> *mut libc::c_char;
}
extern "C" {
pub fn ssh_string_free_char(s: *mut libc::c_char);
}
extern "C" {
pub fn ssh_getpass(prompt: *const libc::c_char, buf: *mut libc::c_char, len: libc::c_ulong, echo: libc::c_int, verify: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_event_new() -> *mut ssh_event_struct;
}
extern "C" {
pub fn ssh_event_add_fd(event: *mut ssh_event_struct, fd: libc::c_int, events: libc::c_short, cb: Option<extern fn(libc::c_int, libc::c_int, *mut libc::c_void) -> libc::c_int>, userdata: *mut libc::c_void) -> libc::c_int;
}
extern "C" {
pub fn ssh_event_add_session(event: *mut ssh_event_struct, session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_event_dopoll(event: *mut ssh_event_struct, timeout: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_event_remove_fd(event: *mut ssh_event_struct, fd: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_event_remove_session(event: *mut ssh_event_struct, session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_event_free(event: *mut ssh_event_struct);
}
extern "C" {
pub fn ssh_get_clientbanner(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_get_serverbanner(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_get_cipher_in(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_get_cipher_out(session: *mut ssh_session_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_auth_list(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_offer_pubkey(session: *mut ssh_session_struct, username: *const libc::c_char, type_: libc::c_int, publickey: *mut ssh_string_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_pubkey(session: *mut ssh_session_struct, username: *const libc::c_char, publickey: *mut ssh_string_struct, privatekey: *mut ssh_private_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_agent_pubkey(session: *mut ssh_session_struct, username: *const libc::c_char, publickey: *mut ssh_public_key_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_autopubkey(session: *mut ssh_session_struct, passphrase: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_userauth_privatekey_file(session: *mut ssh_session_struct, username: *const libc::c_char, filename: *const libc::c_char, passphrase: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn buffer_free(buffer: *mut ssh_buffer_struct);
}
extern "C" {
pub fn buffer_get(buffer: *mut ssh_buffer_struct) -> *mut libc::c_void;
}
extern "C" {
pub fn buffer_get_len(buffer: *mut ssh_buffer_struct) -> libc::c_uint;
}
extern "C" {
pub fn buffer_new() -> *mut ssh_buffer_struct;
}
extern "C" {
pub fn channel_accept_x11(channel: *mut ssh_channel_struct, timeout_ms: libc::c_int) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn channel_change_pty_size(channel: *mut ssh_channel_struct, cols: libc::c_int, rows: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_forward_accept(session: *mut ssh_session_struct, timeout_ms: libc::c_int) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn channel_close(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_forward_cancel(session: *mut ssh_session_struct, address: *const libc::c_char, port: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_forward_listen(session: *mut ssh_session_struct, address: *const libc::c_char, port: libc::c_int, bound_port: *mut libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_free(channel: *mut ssh_channel_struct);
}
extern "C" {
pub fn channel_get_exit_status(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_get_session(channel: *mut ssh_channel_struct) -> *mut ssh_session_struct;
}
extern "C" {
pub fn channel_is_closed(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_is_eof(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_is_open(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_new(session: *mut ssh_session_struct) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn channel_open_forward(channel: *mut ssh_channel_struct, remotehost: *const libc::c_char, remoteport: libc::c_int, sourcehost: *const libc::c_char, localport: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_open_session(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_poll(channel: *mut ssh_channel_struct, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_read(channel: *mut ssh_channel_struct, dest: *mut libc::c_void, count: libc::c_uint, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_read_buffer(channel: *mut ssh_channel_struct, buffer: *mut ssh_buffer_struct, count: libc::c_uint, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_read_nonblocking(channel: *mut ssh_channel_struct, dest: *mut libc::c_void, count: libc::c_uint, is_stderr: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_request_env(channel: *mut ssh_channel_struct, name: *const libc::c_char, value: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn channel_request_exec(channel: *mut ssh_channel_struct, cmd: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn channel_request_pty(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_request_pty_size(channel: *mut ssh_channel_struct, term: *const libc::c_char, cols: libc::c_int, rows: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_request_shell(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_request_send_signal(channel: *mut ssh_channel_struct, signum: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn channel_request_sftp(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_request_subsystem(channel: *mut ssh_channel_struct, subsystem: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn channel_request_x11(channel: *mut ssh_channel_struct, single_connection: libc::c_int, protocol: *const libc::c_char, cookie: *const libc::c_char, screen_number: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn channel_send_eof(channel: *mut ssh_channel_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_select(readchans: *mut *mut ssh_channel_struct, writechans: *mut *mut ssh_channel_struct, exceptchans: *mut *mut ssh_channel_struct, timeout: *mut timeval) -> libc::c_int;
}
extern "C" {
pub fn channel_set_blocking(channel: *mut ssh_channel_struct, blocking: libc::c_int);
}
extern "C" {
pub fn channel_write(channel: *mut ssh_channel_struct, data: *const libc::c_void, len: libc::c_uint) -> libc::c_int;
}
extern "C" {
pub fn privatekey_free(prv: *mut ssh_private_key_struct);
}
extern "C" {
pub fn privatekey_from_file(session: *mut ssh_session_struct, filename: *const libc::c_char, type_: libc::c_int, passphrase: *const libc::c_char) -> *mut ssh_private_key_struct;
}
extern "C" {
pub fn publickey_free(key: *mut ssh_public_key_struct);
}
extern "C" {
pub fn ssh_publickey_to_file(session: *mut ssh_session_struct, file: *const libc::c_char, pubkey: *mut ssh_string_struct, type_: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn publickey_from_file(session: *mut ssh_session_struct, filename: *const libc::c_char, type_: *mut libc::c_int) -> *mut ssh_string_struct;
}
extern "C" {
pub fn publickey_from_privatekey(prv: *mut ssh_private_key_struct) -> *mut ssh_public_key_struct;
}
extern "C" {
pub fn publickey_to_string(key: *mut ssh_public_key_struct) -> *mut ssh_string_struct;
}
extern "C" {
pub fn ssh_try_publickey_from_file(session: *mut ssh_session_struct, keyfile: *const libc::c_char, publickey: *mut *mut ssh_string_struct, type_: *mut libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_privatekey_type(privatekey: *mut ssh_private_key_struct) -> libc::c_uint;
}
extern "C" {
pub fn ssh_get_pubkey(session: *mut ssh_session_struct) -> *mut ssh_string_struct;
}
extern "C" {
pub fn ssh_message_retrieve(session: *mut ssh_session_struct, packettype: libc::c_uint) -> *mut ssh_message_struct;
}
extern "C" {
pub fn ssh_message_auth_publickey(msg: *mut ssh_message_struct) -> *mut ssh_public_key_struct;
}
extern "C" {
pub fn string_burn(str: *mut ssh_string_struct);
}
extern "C" {
pub fn string_copy(str: *mut ssh_string_struct) -> *mut ssh_string_struct;
}
extern "C" {
pub fn string_data(str: *mut ssh_string_struct) -> *mut libc::c_void;
}
extern "C" {
pub fn string_fill(str: *mut ssh_string_struct, data: *const libc::c_void, len: libc::c_ulong) -> libc::c_int;
}
extern "C" {
pub fn string_free(str: *mut ssh_string_struct);
}
extern "C" {
pub fn string_from_char(what: *const libc::c_char) -> *mut ssh_string_struct;
}
extern "C" {
pub fn string_len(str: *mut ssh_string_struct) -> libc::c_ulong;
}
extern "C" {
pub fn string_new(size: libc::c_ulong) -> *mut ssh_string_struct;
}
extern "C" {
pub fn string_to_char(str: *mut ssh_string_struct) -> *mut libc::c_char;
}
extern "C" {
pub fn ssh_bind_new() -> *mut ssh_bind_struct;
}
extern "C" {
pub fn ssh_bind_options_set(sshbind: *mut ssh_bind_struct, type_: libc::c_uint, value: *const libc::c_void) -> libc::c_int;
}
extern "C" {
pub fn ssh_bind_listen(ssh_bind_o: *mut ssh_bind_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_bind_set_callbacks(sshbind: *mut ssh_bind_struct, callbacks: *mut ssh_bind_callbacks_struct, userdata: *mut libc::c_void) -> libc::c_int;
}
extern "C" {
pub fn ssh_bind_set_blocking(ssh_bind_o: *mut ssh_bind_struct, blocking: libc::c_int);
}
extern "C" {
pub fn ssh_bind_get_fd(ssh_bind_o: *mut ssh_bind_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_bind_set_fd(ssh_bind_o: *mut ssh_bind_struct, fd: libc::c_int);
}
extern "C" {
pub fn ssh_bind_fd_toaccept(ssh_bind_o: *mut ssh_bind_struct);
}
extern "C" {
pub fn ssh_bind_accept(ssh_bind_o: *mut ssh_bind_struct, session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_bind_accept_fd(ssh_bind_o: *mut ssh_bind_struct, session: *mut ssh_session_struct, fd: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_gssapi_get_creds(session: *mut ssh_session_struct) -> *mut libc::c_void;
}
extern "C" {
pub fn ssh_handle_key_exchange(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_bind_free(ssh_bind_o: *mut ssh_bind_struct);
}
extern "C" {
pub fn ssh_set_auth_methods(session: *mut ssh_session_struct, auth_methods: libc::c_int);
}
extern "C" {
pub fn ssh_message_reply_default(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_auth_user(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_auth_password(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_auth_pubkey(msg: *mut ssh_message_struct) -> *mut ssh_key_struct;
}
extern "C" {
pub fn ssh_message_auth_kbdint_is_response(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_auth_publickey_state(msg: *mut ssh_message_struct) -> libc::c_uint;
}
extern "C" {
pub fn ssh_message_auth_reply_success(msg: *mut ssh_message_struct, partial: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_auth_reply_pk_ok(msg: *mut ssh_message_struct, algo: *mut ssh_string_struct, pubkey: *mut ssh_string_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_auth_reply_pk_ok_simple(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_auth_set_methods(msg: *mut ssh_message_struct, methods: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_auth_interactive_request(msg: *mut ssh_message_struct, name: *const libc::c_char, instruction: *const libc::c_char, num_prompts: libc::c_uint, prompts: *mut *const libc::c_char, echo: *mut libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_service_reply_success(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_service_service(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_global_request_reply_success(msg: *mut ssh_message_struct, bound_port: libc::c_ushort) -> libc::c_int;
}
extern "C" {
pub fn ssh_set_message_callback(session: *mut ssh_session_struct, ssh_bind_message_callback: Option<extern fn(*mut ssh_session_struct, *mut ssh_message_struct, *mut libc::c_void) -> libc::c_int>, data: *mut libc::c_void);
}
extern "C" {
pub fn ssh_execute_message_callbacks(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_open_originator(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_open_originator_port(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_open_destination(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_open_destination_port(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_channel(msg: *mut ssh_message_struct) -> *mut ssh_channel_struct;
}
extern "C" {
pub fn ssh_message_channel_request_pty_term(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_pty_width(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_pty_height(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_pty_pxwidth(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_pty_pxheight(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_env_name(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_env_value(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_command(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_subsystem(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_x11_single_connection(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_channel_request_x11_auth_protocol(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_x11_auth_cookie(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_channel_request_x11_screen_number(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_message_global_request_address(msg: *mut ssh_message_struct) -> *const libc::c_char;
}
extern "C" {
pub fn ssh_message_global_request_port(msg: *mut ssh_message_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_open_reverse_forward(channel: *mut ssh_channel_struct, remotehost: *const libc::c_char, remoteport: libc::c_int, sourcehost: *const libc::c_char, localport: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_send_exit_status(channel: *mut ssh_channel_struct, exit_status: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_request_send_exit_signal(channel: *mut ssh_channel_struct, signum: *const libc::c_char, core: libc::c_int, errmsg: *const libc::c_char, lang: *const libc::c_char) -> libc::c_int;
}
extern "C" {
pub fn ssh_channel_write_stderr(channel: *mut ssh_channel_struct, data: *const libc::c_void, len: libc::c_uint) -> libc::c_int;
}
extern "C" {
pub fn ssh_send_keepalive(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn ssh_accept(session: *mut ssh_session_struct) -> libc::c_int;
}
extern "C" {
pub fn channel_write_stderr(channel: *mut ssh_channel_struct, data: *const libc::c_void, len: libc::c_uint) -> libc::c_int;
}
#[repr(C)]
pub struct ssh_agent_struct;
#[repr(C)]
pub struct ssh_buffer_struct;
#[repr(C)]
pub struct ssh_channel_struct;
#[repr(C)]
pub struct ssh_message_struct;
#[repr(C)]
pub struct ssh_pcap_file_struct;
#[repr(C)]
pub struct ssh_key_struct;
#[repr(C)]
pub struct ssh_scp_struct;
#[repr(C)]
pub struct ssh_session_struct;
#[repr(C)]
pub struct ssh_string_struct;
#[repr(C)]
pub struct ssh_event_struct;
#[repr(C)]
pub struct ssh_private_key_struct;
#[repr(C)]
pub struct ssh_public_key_struct;
#[repr(C)]
pub struct ssh_bind_struct;
#[repr(C)]
pub struct ssh_bind_callbacks_struct {
size: libc::c_ulong,
incoming_connection: Option<extern fn(*mut ssh_bind_struct, *mut libc::c_void)>,
}
#[repr(C)]
pub struct None;
#[repr(C)]
pub struct timeval {
tv_sec: libc::c_long,
tv_usec: libc::c_long,
}
#[repr(C)]
pub struct fd_set {
__fds_bits: [libc::c_long, ..16],
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_kex_types_e {
SSH_KEX = 0,
SSH_HOSTKEYS = 1,
SSH_CRYPT_C_S = 2,
SSH_CRYPT_S_C = 3,
SSH_MAC_C_S = 4,
SSH_MAC_S_C = 5,
SSH_COMP_C_S = 6,
SSH_COMP_S_C = 7,
SSH_LANG_C_S = 8,
SSH_LANG_S_C = 9,
}
impl ssh_kex_types_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_kex_types_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(i32)]
pub enum ssh_auth_e {
SSH_AUTH_SUCCESS = 0,
SSH_AUTH_DENIED = 1,
SSH_AUTH_PARTIAL = 2,
SSH_AUTH_INFO = 3,
SSH_AUTH_AGAIN = 4,
SSH_AUTH_ERROR = -1,
}
impl ssh_auth_e {
pub fn to_i32(&self) -> libc::c_int {
*self as libc::c_int
}
pub fn from_i32(v: libc::c_int) -> ssh_auth_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_requests_e {
SSH_REQUEST_AUTH = 1,
SSH_REQUEST_CHANNEL_OPEN = 2,
SSH_REQUEST_CHANNEL = 3,
SSH_REQUEST_SERVICE = 4,
SSH_REQUEST_GLOBAL = 5,
}
impl ssh_requests_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_requests_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_channel_type_e {
SSH_CHANNEL_UNKNOWN = 0,
SSH_CHANNEL_SESSION = 1,
SSH_CHANNEL_DIRECT_TCPIP = 2,
SSH_CHANNEL_FORWARDED_TCPIP = 3,
SSH_CHANNEL_X11 = 4,
}
impl ssh_channel_type_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_channel_type_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_channel_requests_e {
SSH_CHANNEL_REQUEST_UNKNOWN = 0,
SSH_CHANNEL_REQUEST_PTY = 1,
SSH_CHANNEL_REQUEST_EXEC = 2,
SSH_CHANNEL_REQUEST_SHELL = 3,
SSH_CHANNEL_REQUEST_ENV = 4,
SSH_CHANNEL_REQUEST_SUBSYSTEM = 5,
SSH_CHANNEL_REQUEST_WINDOW_CHANGE = 6,
SSH_CHANNEL_REQUEST_X11 = 7,
}
impl ssh_channel_requests_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_channel_requests_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_global_requests_e {
SSH_GLOBAL_REQUEST_UNKNOWN = 0,
SSH_GLOBAL_REQUEST_TCPIP_FORWARD = 1,
SSH_GLOBAL_REQUEST_CANCEL_TCPIP_FORWARD = 2,
}
impl ssh_global_requests_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_global_requests_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(i32)]
pub enum ssh_publickey_state_e {
SSH_PUBLICKEY_STATE_ERROR = -1,
SSH_PUBLICKEY_STATE_NONE = 0,
SSH_PUBLICKEY_STATE_VALID = 1,
SSH_PUBLICKEY_STATE_WRONG = 2,
}
impl ssh_publickey_state_e {
pub fn to_i32(&self) -> libc::c_int {
*self as libc::c_int
}
pub fn from_i32(v: libc::c_int) -> ssh_publickey_state_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(i32)]
pub enum ssh_server_known_e {
SSH_SERVER_ERROR = -1,
SSH_SERVER_NOT_KNOWN = 0,
SSH_SERVER_KNOWN_OK = 1,
SSH_SERVER_KNOWN_CHANGED = 2,
SSH_SERVER_FOUND_OTHER = 3,
SSH_SERVER_FILE_NOT_FOUND = 4,
}
impl ssh_server_known_e {
pub fn to_i32(&self) -> libc::c_int {
*self as libc::c_int
}
pub fn from_i32(v: libc::c_int) -> ssh_server_known_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_error_types_e {
SSH_NO_ERROR = 0,
SSH_REQUEST_DENIED = 1,
SSH_FATAL = 2,
SSH_EINTR = 3,
}
impl ssh_error_types_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_error_types_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_keytypes_e {
SSH_KEYTYPE_UNKNOWN = 0,
SSH_KEYTYPE_DSS = 1,
SSH_KEYTYPE_RSA = 2,
SSH_KEYTYPE_RSA1 = 3,
SSH_KEYTYPE_ECDSA = 4,
}
impl ssh_keytypes_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_keytypes_e {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_keycmp_e {
SSH_KEY_CMP_PUBLIC = 0,
SSH_KEY_CMP_PRIVATE = 1,
}
impl ssh_keycmp_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_keycmp_e {
unsafe { mem::transmute(v) }
}
}
pub const SSH_LOG_NOLOG: i32 = 0;
pub const SSH_LOG_WARNING: i32 = 1;
pub const SSH_LOG_PROTOCOL: i32 = 2;
pub const SSH_LOG_PACKET: i32 = 3;
pub const SSH_LOG_FUNCTIONS: i32 = 4;
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_options_e {
SSH_OPTIONS_HOST = 0,
SSH_OPTIONS_PORT = 1,
SSH_OPTIONS_PORT_STR = 2,
SSH_OPTIONS_FD = 3,
SSH_OPTIONS_USER = 4,
SSH_OPTIONS_SSH_DIR = 5,
SSH_OPTIONS_IDENTITY = 6,
SSH_OPTIONS_ADD_IDENTITY = 7,
SSH_OPTIONS_KNOWNHOSTS = 8,
SSH_OPTIONS_TIMEOUT = 9,
SSH_OPTIONS_TIMEOUT_USEC = 10,
SSH_OPTIONS_SSH1 = 11,
SSH_OPTIONS_SSH2 = 12,
SSH_OPTIONS_LOG_VERBOSITY = 13,
SSH_OPTIONS_LOG_VERBOSITY_STR = 14,
SSH_OPTIONS_CIPHERS_C_S = 15,
SSH_OPTIONS_CIPHERS_S_C = 16,
SSH_OPTIONS_COMPRESSION_C_S = 17,
SSH_OPTIONS_COMPRESSION_S_C = 18,
SSH_OPTIONS_PROXYCOMMAND = 19,
SSH_OPTIONS_BINDADDR = 20,
SSH_OPTIONS_STRICTHOSTKEYCHECK = 21,
SSH_OPTIONS_COMPRESSION = 22,
SSH_OPTIONS_COMPRESSION_LEVEL = 23,
SSH_OPTIONS_KEY_EXCHANGE = 24,
SSH_OPTIONS_HOSTKEYS = 25,
SSH_OPTIONS_GSSAPI_SERVER_IDENTITY = 26,
SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY = 27,
SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS = 28,
}
impl ssh_options_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_options_e {
unsafe { mem::transmute(v) }
}
}
pub const SSH_SCP_WRITE: i32 = 0;
pub const SSH_SCP_READ: i32 = 1;
pub const SSH_SCP_RECURSIVE: i32 = 16;
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_scp_request_types {
SSH_SCP_REQUEST_NEWDIR = 1,
SSH_SCP_REQUEST_NEWFILE = 2,
SSH_SCP_REQUEST_EOF = 3,
SSH_SCP_REQUEST_ENDDIR = 4,
SSH_SCP_REQUEST_WARNING = 5,
}
impl ssh_scp_request_types {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_scp_request_types {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_publickey_hash_type {
SSH_PUBLICKEY_HASH_SHA1 = 0,
SSH_PUBLICKEY_HASH_MD5 = 1,
}
impl ssh_publickey_hash_type {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_publickey_hash_type {
unsafe { mem::transmute(v) }
}
}
#[deriving(Copy, PartialEq, Show)]
#[repr(u32)]
pub enum ssh_bind_options_e {
SSH_BIND_OPTIONS_BINDADDR = 0,
SSH_BIND_OPTIONS_BINDPORT = 1,
SSH_BIND_OPTIONS_BINDPORT_STR = 2,
SSH_BIND_OPTIONS_HOSTKEY = 3,
SSH_BIND_OPTIONS_DSAKEY = 4,
SSH_BIND_OPTIONS_RSAKEY = 5,
SSH_BIND_OPTIONS_BANNER = 6,
SSH_BIND_OPTIONS_LOG_VERBOSITY = 7,
SSH_BIND_OPTIONS_LOG_VERBOSITY_STR = 8,
}
impl ssh_bind_options_e {
pub fn to_u32(&self) -> libc::c_uint {
*self as libc::c_uint
}
pub fn from_u32(v: libc::c_uint) -> ssh_bind_options_e {
unsafe { mem::transmute(v) }
}
}
pub const LIBSSH_VERSION_MAJOR: i32 = 0;
pub const LIBSSH_VERSION_MINOR: i32 = 6;
pub const LIBSSH_VERSION_MICRO: i32 = 3;
pub const SSH_CRYPT: i32 = 2;
pub const SSH_MAC: i32 = 3;
pub const SSH_COMP: i32 = 4;
pub const SSH_LANG: i32 = 5;
pub const SSH_AUTH_METHOD_UNKNOWN: i32 = 0;
pub const SSH_AUTH_METHOD_NONE: i32 = 1;
pub const SSH_AUTH_METHOD_PASSWORD: i32 = 2;
pub const SSH_AUTH_METHOD_PUBLICKEY: i32 = 4;
pub const SSH_AUTH_METHOD_HOSTBASED: i32 = 8;
pub const SSH_AUTH_METHOD_INTERACTIVE: i32 = 16;
pub const SSH_AUTH_METHOD_GSSAPI_MIC: i32 = 32;
pub const SSH_CLOSED: i32 = 1;
pub const SSH_READ_PENDING: i32 = 2;
pub const SSH_CLOSED_ERROR: i32 = 4;
pub const SSH_WRITE_PENDING: i32 = 8;
pub const MD5_DIGEST_LEN: i32 = 16;
pub const SSH_OK: i32 = 0;
pub const SSH_ERROR: i32 = -1;
pub const SSH_AGAIN: i32 = -2;
pub const SSH_EOF: i32 = -127;
pub const SSH_LOG_NONE: i32 = 0;
pub const SSH_LOG_WARN: i32 = 1;
pub const SSH_LOG_INFO: i32 = 2;
pub const SSH_LOG_DEBUG: i32 = 3;
pub const SSH_LOG_TRACE: i32 = 4;