mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Replace enum+union of local channel types with a vtable.
There's now an interface called 'Channel', which handles the local side of an SSH connection-layer channel, in terms of knowing where to send incoming channel data to, whether to close the channel, etc. Channel and the previous 'struct ssh_channel' mutually refer. The latter contains all the SSH-specific parts, and as much of the common logic as possible: in particular, Channel doesn't have to know anything about SSH packet formats, or which SSH protocol version is in use, or deal with all the fiddly stuff about window sizes - with the exception that x11fwd.c's implementation of it does have to be able to ask for a small fixed initial window size for the bodgy system that distinguishes upstream from downstream X forwardings. I've taken the opportunity to move the code implementing the detailed behaviour of agent forwarding out of ssh.c, now that all of it is on the far side of a uniform interface. (This also means that if I later implement agent forwarding directly to a Unix socket as an alternative, it'll be a matter of changing just the one call to agentf_new() that makes the Channel to plug into a forwarding.)
This commit is contained in:
@ -161,13 +161,17 @@ int sshfwd_write(struct ssh_channel *c, const void *data, int len)
|
||||
void sshfwd_write_eof(struct ssh_channel *c) { }
|
||||
void sshfwd_unclean_close(struct ssh_channel *c, const char *err) { }
|
||||
void sshfwd_unthrottle(struct ssh_channel *c, int bufsize) {}
|
||||
void sshfwd_window_override_removed(struct ssh_channel *c) { }
|
||||
void chan_remotely_opened_confirmation(Channel *chan) { }
|
||||
void chan_remotely_opened_failure(Channel *chan, const char *err) { }
|
||||
int chan_no_eager_close(Channel *chan, int s, int r) { return FALSE; }
|
||||
|
||||
Conf *sshfwd_get_conf(struct ssh_channel *c) { return NULL; }
|
||||
void sshfwd_x11_sharing_handover(struct ssh_channel *c,
|
||||
void *share_cs, void *share_chan,
|
||||
const char *peer_addr, int peer_port,
|
||||
int endian, int protomajor, int protominor,
|
||||
const void *initial_data, int initial_len) {}
|
||||
void sshfwd_x11_is_local(struct ssh_channel *c) {}
|
||||
|
||||
/*
|
||||
* These functions are part of the plug for our connection to the X
|
||||
|
Reference in New Issue
Block a user