summaryrefslogtreecommitdiff
path: root/channels.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-25 22:49:38 +0000
committerDamien Miller <djm@mindrot.org>2020-01-26 10:15:13 +1100
commit065064fcf455778b0918f783033b374d4ba37a92 (patch)
tree86ac1a78dd4dd42b43db30d301976663ec088e27 /channels.h
parent69334996ae203c51c70bf01d414c918a44618f8e (diff)
upstream: add a comment describing the ranges of channel IDs that
we use; requested by markus@ OpenBSD-Commit-ID: 83a1f09810ffa3a96a55fbe32675b34ba739e56b
Diffstat (limited to 'channels.h')
-rw-r--r--channels.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/channels.h b/channels.h
index aa2a87c10..c8ae0d904 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.h,v 1.132 2018/10/04 00:10:11 djm Exp $ */ 1/* $OpenBSD: channels.h,v 1.133 2020/01/25 22:49:38 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -105,8 +105,16 @@ struct channel_connect {
105/* Callbacks for mux channels back into client-specific code */ 105/* Callbacks for mux channels back into client-specific code */
106typedef int mux_callback_fn(struct ssh *, struct Channel *); 106typedef int mux_callback_fn(struct ssh *, struct Channel *);
107 107
108/*
109 * NB. channel IDs on the wire and in c->remote_id are uint32, but local
110 * channel IDs (e.g. c->self) only ever use the int32 subset of this range,
111 * because we use local channel ID -1 for housekeeping. Remote channels have
112 * a dedicated "have_remote_id" flag to indicate their validity.
113 */
114
108struct Channel { 115struct Channel {
109 int type; /* channel type/state */ 116 int type; /* channel type/state */
117
110 int self; /* my own channel identifier */ 118 int self; /* my own channel identifier */
111 uint32_t remote_id; /* channel identifier for remote peer */ 119 uint32_t remote_id; /* channel identifier for remote peer */
112 int have_remote_id; /* non-zero if remote_id is valid */ 120 int have_remote_id; /* non-zero if remote_id is valid */