ssh_connection_handler

DATA TYPES

channel_id() = integer()
gen_fsm_state_return() = {next_state, state_name(), term()} | {next_state, state_name(), term(), timeout()} | {stop, term(), term()}
state_name() = hello | kexinit | key_exchange | new_keys | userauth | connection

Functions


start_connection(Role::client | server, Socket::port(), Options::proplist() (see module proplists), Timeout::timeout()) -> {ok, pid()} | {error, term()}

start_link(Role, Socket, Options) -> term()

init(X1) -> term()

open_channel(ConnectionHandler::pid(), ChannelType::string(), ChannelSpecificData::iodata(), InitialWindowSize::integer(), MaxPacketSize::integer(), Timeout::timeout()) -> {open, channel_id()} | {open_error, term(), string(), string()}

request(ConnectionHandler::pid(), ChannelPid::pid(), ChannelId::channel_id(), Type::string(), X5::boolean(), Data::iodata(), Timeout::timeout()) -> success | failure | ok | {error, term()}

request(ConnectionHandler::pid(), ChannelId::channel_id(), Type::string(), X4::boolean(), Data::iodata(), Timeout::timeout()) -> success | failure | {error, timeout}

reply_request(ConnectionHandler::pid(), Status::success | failure, ChannelId::channel_id()) -> ok

global_request(ConnectionHandler::pid(), Type::string(), Reply::boolean(), Data::iolist()) -> ok | error

send(ConnectionHandler::pid(), ChannelId::channel_id(), Type::integer(), Data::iolist(), Timeout::timeout()) -> ok | {error, timeout} | {error, closed}

send_eof(ConnectionHandler::pid(), ChannelId::channel_id()) -> ok | {error, closed}

connection_info(ConnectionHandler::pid(), Options::[atom()]) -> proplist() (see module proplists)

channel_info(ConnectionHandler::pid(), ChannelId::channel_id(), Options::[atom()]) -> proplist() (see module proplists)

adjust_window(ConnectionHandler::pid(), Channel::channel_id(), Bytes::integer()) -> ok

renegotiate(ConnectionHandler::pid()) -> ok

renegotiate_data(ConnectionHandler::pid()) -> ok

close(ConnectionHandler::pid(), ChannelId::channel_id()) -> ok

stop(ConnectionHandler::pid()) -> ok | {error, term()}

info(ConnectionHandler) -> term()

info(ConnectionHandler, ChannelProcess) -> term()

hello(X1::socket_control | {info_line, list()} | {version_exchange, list()}, State::#state{}) -> gen_fsm_state_return()

kexinit(X1::{#ssh_msg_kexinit{}, binary()}, State::#state{}) -> gen_fsm_state_return()

key_exchange(Ssh_msg_kexdh_init::#ssh_msg_kexdh_init{} | #ssh_msg_kexdh_reply{} | #ssh_msg_kex_dh_gex_group{} | #ssh_msg_kex_dh_gex_request{} | #ssh_msg_kex_dh_gex_request{} | #ssh_msg_kex_dh_gex_reply{}, State::#state{}) -> gen_fsm_state_return()

new_keys(Ssh_msg_newkeys::#ssh_msg_newkeys{}, State::#state{}) -> gen_fsm_state_return()

userauth(Ssh_msg_service_request::#ssh_msg_service_request{} | #ssh_msg_service_accept{} | #ssh_msg_userauth_request{} | #ssh_msg_userauth_info_request{} | #ssh_msg_userauth_info_response{} | #ssh_msg_userauth_success{} | #ssh_msg_userauth_failure{} | #ssh_msg_userauth_banner{}, State::#state{}) -> gen_fsm_state_return()

connected(Event::{#ssh_msg_kexinit{}, binary()}, State::#state{}) -> gen_fsm_state_return()

handle_event(Ssh_msg_disconnect::#ssh_msg_disconnect{} | #ssh_msg_ignore{} | #ssh_msg_debug{} | #ssh_msg_unimplemented{} | {adjust_window, integer(), integer()} | {reply_request, success | failure, integer()} | renegotiate | data_size | {request, pid(), integer(), integer(), iolist()} | {request, integer(), integer(), iolist()}, StateName::state_name(), State::#state{}) -> gen_fsm_state_return()

handle_sync_event(Request::{request, pid(), channel_id(), integer(), binary(), timeout()} | {request, channel_id(), integer(), binary(), timeout()} | {global_request, pid(), integer(), boolean(), binary()} | {eof, integer()} | {open, pid(), integer(), channel_id(), integer(), binary(), term()} | {send_window, channel_id()} | {recv_window, channel_id()} | {connection_info, [client_version | server_version | peer | sockname]} | {channel_info, channel_id(), [recv_window | send_window]} | {close, channel_id()} | stop, From::term(), StateName::state_name(), State::#state{}) -> gen_fsm_state_return()

handle_info(UnexpectedMessage::{atom(), port(), binary()} | {atom(), port()} | term(), Statename::state_name(), State::#state{}) -> gen_fsm_state_return()

terminate(Reason::term(), StateName::state_name(), State::#state{}) -> term()

code_change(OldVsn::term(), StateName::state_name(), Oldstate::term(), Extra::term()) -> {ok, state_name(), #state{}}