summaryrefslogtreecommitdiff
path: root/channels.h
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2016-09-30 09:19:13 +0000
committerDamien Miller <djm@mindrot.org>2016-10-01 02:45:10 +1000
commit8d0578478586e283e751ca51e7b0690631da139a (patch)
tree3621da2b97213f8ff0b434f5fd239dfd4f50d83d /channels.h
parentb7689155f3f5c4999846c07a852b1c7a43b09cec (diff)
upstream commit
ssh proxy mux mode (-O proxy; idea from Simon Tatham): - mux client speaks the ssh-packet protocol directly over unix-domain socket. - mux server acts as a proxy, translates channel IDs and relays to the server. - no filedescriptor passing necessary. - combined with unix-domain forwarding it's even possible to run mux client and server on different machines. feedback & ok djm@ Upstream-ID: 666a2fb79f58e5c50e246265fb2b9251e505c25b
Diffstat (limited to 'channels.h')
-rw-r--r--channels.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/channels.h b/channels.h
index 9d76c9d2a..95363e98a 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.h,v 1.118 2015/07/01 02:26:31 djm Exp $ */ 1/* $OpenBSD: channels.h,v 1.119 2016/09/30 09:19:13 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -58,7 +58,8 @@
58#define SSH_CHANNEL_ABANDONED 17 /* Abandoned session, eg mux */ 58#define SSH_CHANNEL_ABANDONED 17 /* Abandoned session, eg mux */
59#define SSH_CHANNEL_UNIX_LISTENER 18 /* Listening on a domain socket. */ 59#define SSH_CHANNEL_UNIX_LISTENER 18 /* Listening on a domain socket. */
60#define SSH_CHANNEL_RUNIX_LISTENER 19 /* Listening to a R-style domain socket. */ 60#define SSH_CHANNEL_RUNIX_LISTENER 19 /* Listening to a R-style domain socket. */
61#define SSH_CHANNEL_MAX_TYPE 20 61#define SSH_CHANNEL_MUX_PROXY 20 /* proxy channel for mux-slave */
62#define SSH_CHANNEL_MAX_TYPE 21
62 63
63#define CHANNEL_CANCEL_PORT_STATIC -1 64#define CHANNEL_CANCEL_PORT_STATIC -1
64 65
@@ -162,6 +163,7 @@ struct Channel {
162 mux_callback_fn *mux_rcb; 163 mux_callback_fn *mux_rcb;
163 void *mux_ctx; 164 void *mux_ctx;
164 int mux_pause; 165 int mux_pause;
166 int mux_downstream_id;
165}; 167};
166 168
167#define CHAN_EXTENDED_IGNORE 0 169#define CHAN_EXTENDED_IGNORE 0
@@ -209,6 +211,7 @@ struct Channel {
209/* channel management */ 211/* channel management */
210 212
211Channel *channel_by_id(int); 213Channel *channel_by_id(int);
214Channel *channel_by_remote_id(int);
212Channel *channel_lookup(int); 215Channel *channel_lookup(int);
213Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int); 216Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int);
214void channel_set_fds(int, int, int, int, int, int, int, u_int); 217void channel_set_fds(int, int, int, int, int, int, int, u_int);
@@ -228,6 +231,11 @@ void channel_cancel_cleanup(int);
228int channel_close_fd(int *); 231int channel_close_fd(int *);
229void channel_send_window_changes(void); 232void channel_send_window_changes(void);
230 233
234/* mux proxy support */
235
236int channel_proxy_downstream(Channel *mc);
237int channel_proxy_upstream(Channel *, int, u_int32_t, void *);
238
231/* protocol handler */ 239/* protocol handler */
232 240
233int channel_input_close(int, u_int32_t, void *); 241int channel_input_close(int, u_int32_t, void *);