diff options
Diffstat (limited to 'channels.h')
-rw-r--r-- | channels.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/channels.h b/channels.h index 79ebe047a..cc71885f4 100644 --- a/channels.h +++ b/channels.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.h,v 1.102 2010/01/11 01:39:46 dtucker Exp $ */ | 1 | /* $OpenBSD: channels.h,v 1.103 2010/01/26 01:28:35 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -53,7 +53,9 @@ | |||
53 | #define SSH_CHANNEL_CONNECTING 12 | 53 | #define SSH_CHANNEL_CONNECTING 12 |
54 | #define SSH_CHANNEL_DYNAMIC 13 | 54 | #define SSH_CHANNEL_DYNAMIC 13 |
55 | #define SSH_CHANNEL_ZOMBIE 14 /* Almost dead. */ | 55 | #define SSH_CHANNEL_ZOMBIE 14 /* Almost dead. */ |
56 | #define SSH_CHANNEL_MAX_TYPE 15 | 56 | #define SSH_CHANNEL_MUX_LISTENER 15 /* Listener for mux conn. */ |
57 | #define SSH_CHANNEL_MUX_CLIENT 16 /* Conn. to mux slave */ | ||
58 | #define SSH_CHANNEL_MAX_TYPE 17 | ||
57 | 59 | ||
58 | struct Channel; | 60 | struct Channel; |
59 | typedef struct Channel Channel; | 61 | typedef struct Channel Channel; |
@@ -81,6 +83,9 @@ struct channel_connect { | |||
81 | struct addrinfo *ai, *aitop; | 83 | struct addrinfo *ai, *aitop; |
82 | }; | 84 | }; |
83 | 85 | ||
86 | /* Callbacks for mux channels back into client-specific code */ | ||
87 | typedef int mux_callback_fn(struct Channel *); | ||
88 | |||
84 | struct Channel { | 89 | struct Channel { |
85 | int type; /* channel type/state */ | 90 | int type; /* channel type/state */ |
86 | int self; /* my own channel identifier */ | 91 | int self; /* my own channel identifier */ |
@@ -92,7 +97,7 @@ struct Channel { | |||
92 | int wfd; /* write fd */ | 97 | int wfd; /* write fd */ |
93 | int efd; /* extended fd */ | 98 | int efd; /* extended fd */ |
94 | int sock; /* sock fd */ | 99 | int sock; /* sock fd */ |
95 | int ctl_fd; /* control fd (client sharing) */ | 100 | int ctl_chan; /* control channel (multiplexed connections) */ |
96 | int isatty; /* rfd is a tty */ | 101 | int isatty; /* rfd is a tty */ |
97 | int wfd_isatty; /* wfd is a tty */ | 102 | int wfd_isatty; /* wfd is a tty */ |
98 | int client_tty; /* (client) TTY has been requested */ | 103 | int client_tty; /* (client) TTY has been requested */ |
@@ -142,6 +147,10 @@ struct Channel { | |||
142 | 147 | ||
143 | /* non-blocking connect */ | 148 | /* non-blocking connect */ |
144 | struct channel_connect connect_ctx; | 149 | struct channel_connect connect_ctx; |
150 | |||
151 | /* multiplexing protocol hook, called for each packet received */ | ||
152 | mux_callback_fn *mux_rcb; | ||
153 | void *mux_ctx; | ||
145 | }; | 154 | }; |
146 | 155 | ||
147 | #define CHAN_EXTENDED_IGNORE 0 | 156 | #define CHAN_EXTENDED_IGNORE 0 |
@@ -172,6 +181,7 @@ struct Channel { | |||
172 | #define CHAN_CLOSE_RCVD 0x02 | 181 | #define CHAN_CLOSE_RCVD 0x02 |
173 | #define CHAN_EOF_SENT 0x04 | 182 | #define CHAN_EOF_SENT 0x04 |
174 | #define CHAN_EOF_RCVD 0x08 | 183 | #define CHAN_EOF_RCVD 0x08 |
184 | #define CHAN_LOCAL 0x10 | ||
175 | 185 | ||
176 | #define CHAN_RBUF 16*1024 | 186 | #define CHAN_RBUF 16*1024 |
177 | 187 | ||
@@ -243,7 +253,7 @@ void channel_clear_adm_permitted_opens(void); | |||
243 | void channel_print_adm_permitted_opens(void); | 253 | void channel_print_adm_permitted_opens(void); |
244 | int channel_input_port_forward_request(int, int); | 254 | int channel_input_port_forward_request(int, int); |
245 | Channel *channel_connect_to(const char *, u_short, char *, char *); | 255 | Channel *channel_connect_to(const char *, u_short, char *, char *); |
246 | Channel *channel_connect_stdio_fwd(const char*, u_short); | 256 | Channel *channel_connect_stdio_fwd(const char*, u_short, int, int); |
247 | Channel *channel_connect_by_listen_address(u_short, char *, char *); | 257 | Channel *channel_connect_by_listen_address(u_short, char *, char *); |
248 | int channel_request_remote_forwarding(const char *, u_short, | 258 | int channel_request_remote_forwarding(const char *, u_short, |
249 | const char *, u_short); | 259 | const char *, u_short); |