Trait thrussh::Client [] [src]

pub trait Client {
    fn auth_banner(&mut self, banner: &str) { ... }
    fn check_server_key(&self, server_public_key: &PublicKey) -> bool { ... }
    fn channel_open_confirmation(&self, channel: u32, session: &mut Session) -> Result<()Error> { ... }
    fn channel_open_failure(&self, channel: u32, reason: ChannelOpenFailure, description: &str, language: &str, session: &mut Session) -> Result<()Error> { ... }
    fn channel_open_forwarded_tcpip(&mut self, channel: u32, connected_address: &str, connected_port: u32, originator_address: &str, originator_port: u32, session: &mut Session) { ... }
    fn data(&mut self, channel: u32, extended_code: Option<u32>, data: &[u8], session: &mut Session) -> Result<()Error> { ... }
    fn xon_xoff(&mut self, channel: u32, client_can_do: bool, session: &mut Session) -> Result<()Error> { ... }
    fn exit_status(&mut self, channel: u32, exit_status: u32, session: &mut Session) -> Result<()Error> { ... }
    fn exit_signal(&mut self, channel: u32, signal_name: Sig, core_dumped: bool, error_message: &str, lang_tag: &str, session: &mut Session) -> Result<()Error> { ... }
    fn window_adjusted(&mut self, channel: u32, session: &mut Session) -> Result<()Error> { ... }
}

Provided Methods

fn auth_banner(&mut self, banner: &str)

Called when the server sends us an authentication banner. This is usually meant to be shown to the user, see RFC4252 for more details.

fn check_server_key(&self, server_public_key: &PublicKey) -> bool

Called to check the server's public key. This is a very important step to help prevent man-in-the-middle attacks. The default implementation rejects all keys.

fn channel_open_confirmation(&self, channel: u32, session: &mut Session) -> Result<()Error>

Called when the server confirmed our request to open a channel. A channel can only be written to after receiving this message (this library panics otherwise).

fn channel_open_failure(&self, channel: u32, reason: ChannelOpenFailure, description: &str, language: &str, session: &mut Session) -> Result<()Error>

Called when the server rejected our request to open a channel.

fn channel_open_forwarded_tcpip(&mut self, channel: u32, connected_address: &str, connected_port: u32, originator_address: &str, originator_port: u32, session: &mut Session)

Called when a new channel is created.

fn data(&mut self, channel: u32, extended_code: Option<u32>, data: &[u8], session: &mut Session) -> Result<()Error>

Called when the server sends us data. The extended_code parameter is a stream identifier, None is usually the standard output, and Some(1) is the standard error. See RFC4254.

fn xon_xoff(&mut self, channel: u32, client_can_do: bool, session: &mut Session) -> Result<()Error>

The server informs this client of whether the client may perform control-S/control-Q flow control. See RFC4254.

fn exit_status(&mut self, channel: u32, exit_status: u32, session: &mut Session) -> Result<()Error>

The remote process has exited, with the given exit status.

fn exit_signal(&mut self, channel: u32, signal_name: Sig, core_dumped: bool, error_message: &str, lang_tag: &str, session: &mut Session) -> Result<()Error>

The remote process exited upon receiving a signal.

fn window_adjusted(&mut self, channel: u32, session: &mut Session) -> Result<()Error>

Called when the network window is adjusted, meaning that we can send more bytes. This is useful if this client wants to send huge amounts of data, for instance if we have called client::Session::data before, and it returned less than the full amount of data.

Implementors