diff options
author | markus@openbsd.org <markus@openbsd.org> | 2016-09-30 09:19:13 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-10-01 02:45:10 +1000 |
commit | 8d0578478586e283e751ca51e7b0690631da139a (patch) | |
tree | 3621da2b97213f8ff0b434f5fd239dfd4f50d83d /channels.h | |
parent | b7689155f3f5c4999846c07a852b1c7a43b09cec (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.h | 12 |
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 | ||
211 | Channel *channel_by_id(int); | 213 | Channel *channel_by_id(int); |
214 | Channel *channel_by_remote_id(int); | ||
212 | Channel *channel_lookup(int); | 215 | Channel *channel_lookup(int); |
213 | Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int); | 216 | Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int); |
214 | void channel_set_fds(int, int, int, int, int, int, int, u_int); | 217 | void channel_set_fds(int, int, int, int, int, int, int, u_int); |
@@ -228,6 +231,11 @@ void channel_cancel_cleanup(int); | |||
228 | int channel_close_fd(int *); | 231 | int channel_close_fd(int *); |
229 | void channel_send_window_changes(void); | 232 | void channel_send_window_changes(void); |
230 | 233 | ||
234 | /* mux proxy support */ | ||
235 | |||
236 | int channel_proxy_downstream(Channel *mc); | ||
237 | int channel_proxy_upstream(Channel *, int, u_int32_t, void *); | ||
238 | |||
231 | /* protocol handler */ | 239 | /* protocol handler */ |
232 | 240 | ||
233 | int channel_input_close(int, u_int32_t, void *); | 241 | int channel_input_close(int, u_int32_t, void *); |