aboutsummaryrefslogtreecommitdiff
path: root/channels.h
diff options
context:
space:
mode:
Diffstat (limited to 'channels.h')
-rw-r--r--channels.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/channels.h b/channels.h
index 828c1b61b443..101843a06d15 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.h,v 1.143 2022/05/05 00:56:58 djm Exp $ */
+/* $OpenBSD: channels.h,v 1.148 2023/01/18 02:00:10 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -88,7 +88,7 @@ typedef struct Channel Channel;
struct fwd_perm_list;
typedef void channel_open_fn(struct ssh *, int, int, void *);
-typedef void channel_callback_fn(struct ssh *, int, void *);
+typedef void channel_callback_fn(struct ssh *, int, int, void *);
typedef int channel_infilter_fn(struct ssh *, struct Channel *, char *, int);
typedef void channel_filter_cleanup_fn(struct ssh *, int, void *);
typedef u_char *channel_outfilter_fn(struct ssh *, struct Channel *,
@@ -153,6 +153,7 @@ struct Channel {
* this way post-IO handlers are not
* accidentally called if a FD gets reused */
int restore_block; /* fd mask to restore blocking status */
+ int restore_flags[3];/* flags to restore */
struct sshbuf *input; /* data read from socket, to be sent over
* encrypted connection */
struct sshbuf *output; /* data received over encrypted connection for
@@ -175,7 +176,8 @@ struct Channel {
int extended_usage;
int single_connection;
- char *ctype; /* type */
+ char *ctype; /* const type - NB. not freed on channel_free */
+ char *xctype; /* extended type */
/* callback */
channel_open_fn *open_confirm;
@@ -202,6 +204,13 @@ struct Channel {
void *mux_ctx;
int mux_pause;
int mux_downstream_id;
+
+ /* Inactivity timeouts */
+
+ /* Last traffic seen for OPEN channels */
+ time_t lastused;
+ /* Inactivity timeout deadline in seconds (0 = no timeout) */
+ u_int inactive_deadline;
};
#define CHAN_EXTENDED_IGNORE 0
@@ -281,6 +290,8 @@ void channel_set_fds(struct ssh *, int, int, int, int, int,
void channel_free(struct ssh *, Channel *);
void channel_free_all(struct ssh *);
void channel_stop_listening(struct ssh *);
+void channel_force_close(struct ssh *, Channel *, int);
+void channel_set_xtype(struct ssh *, int, const char *);
void channel_send_open(struct ssh *, int);
void channel_request_start(struct ssh *, int, char *, int);
@@ -296,6 +307,10 @@ void channel_cancel_cleanup(struct ssh *, int);
int channel_close_fd(struct ssh *, Channel *, int *);
void channel_send_window_changes(struct ssh *);
+/* channel inactivity timeouts */
+void channel_add_timeout(struct ssh *, const char *, u_int);
+void channel_clear_timeouts(struct ssh *);
+
/* mux proxy support */
int channel_proxy_downstream(struct ssh *, Channel *mc);
@@ -315,9 +330,10 @@ int channel_input_status_confirm(int, u_int32_t, struct ssh *);
/* file descriptor handling (read/write) */
struct pollfd;
+struct timespec;
void channel_prepare_poll(struct ssh *, struct pollfd **,
- u_int *, u_int *, u_int, time_t *);
+ u_int *, u_int *, u_int, struct timespec *);
void channel_after_poll(struct ssh *, struct pollfd *, u_int);
void channel_output_poll(struct ssh *);