diff options
Diffstat (limited to 'channels.h')
-rw-r--r-- | channels.h | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: channels.h,v 1.137 2021/04/03 06:18:40 djm Exp $ */ +/* $OpenBSD: channels.h,v 1.138 2021/05/19 01:24:05 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -63,6 +63,16 @@ #define CHANNEL_CANCEL_PORT_STATIC -1 +/* nonblocking flags for channel_new */ +#define CHANNEL_NONBLOCK_LEAVE 0 /* don't modify non-blocking state */ +#define CHANNEL_NONBLOCK_SET 1 /* set non-blocking state */ +#define CHANNEL_NONBLOCK_STDIO 2 /* set non-blocking and restore on close */ + +/* c->restore_block mask flags */ +#define CHANNEL_RESTORE_RFD 0x01 +#define CHANNEL_RESTORE_WFD 0x02 +#define CHANNEL_RESTORE_EFD 0x04 + /* TCP forwarding */ #define FORWARD_DENY 0 #define FORWARD_REMOTE (1) @@ -139,6 +149,7 @@ struct Channel { * to a matching pre-select handler. * this way post-select handlers are not * accidentally called if a FD gets reused */ + int restore_block; /* fd mask to restore blocking status */ struct sshbuf *input; /* data read from socket, to be sent over * encrypted connection */ struct sshbuf *output; /* data received over encrypted connection for @@ -266,7 +277,7 @@ void channel_register_filter(struct ssh *, int, channel_infilter_fn *, void channel_register_status_confirm(struct ssh *, int, channel_confirm_cb *, channel_confirm_abandon_cb *, void *); void channel_cancel_cleanup(struct ssh *, int); -int channel_close_fd(struct ssh *, int *); +int channel_close_fd(struct ssh *, Channel *, int *); void channel_send_window_changes(struct ssh *); /* mux proxy support */ @@ -313,7 +324,7 @@ Channel *channel_connect_to_port(struct ssh *, const char *, u_short, char *, char *, int *, const char **); Channel *channel_connect_to_path(struct ssh *, const char *, char *, char *); Channel *channel_connect_stdio_fwd(struct ssh *, const char*, - u_short, int, int); + u_short, int, int, int); Channel *channel_connect_by_listen_address(struct ssh *, const char *, u_short, char *, char *); Channel *channel_connect_by_listen_path(struct ssh *, const char *, |