mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
Low-level API to open nonstandard port forwardings.
The new portfwdmgr_connect_socket() works basically like the existing portfwdmgr_connect(), in that it opens an SSH forwarding channel and gateways it to a Socket. But where portfwdmgr_connect() started from a (hostname,port) pair and used mgr->conf to inform name lookup and proxy settings, portfwdmgr_connect_socket() simply takes a callback that it will call when it wants you to make a Socket for a given Plug, and that callback can make any kind of Socket it likes. The idea is that this way you can make port forwardings that talk to things other than genuine TCP connections, by simply providing an appropriate callback. My immediate use case for this is for agent forwarding, and will appear in the next commit. But it's easy to imagine other purposes you might use a thing like this for, such as forwarding SSH channels to AF_UNIX sockets in general.
This commit is contained in:
3
ssh.h
3
ssh.h
@ -380,6 +380,9 @@ void portfwdmgr_close_all(PortFwdManager *mgr);
|
||||
char *portfwdmgr_connect(PortFwdManager *mgr, Channel **chan_ret,
|
||||
char *hostname, int port, SshChannel *c,
|
||||
int addressfamily);
|
||||
char *portfwdmgr_connect_socket(PortFwdManager *mgr, Channel **chan_ret,
|
||||
Socket *(*connect)(void *, Plug *), void *ctx,
|
||||
SshChannel *c);
|
||||
bool portfwdmgr_listen(PortFwdManager *mgr, const char *host, int port,
|
||||
const char *keyhost, int keyport, Conf *conf);
|
||||
bool portfwdmgr_unlisten(PortFwdManager *mgr, const char *host, int port);
|
||||
|
Reference in New Issue
Block a user