diff options
Diffstat (limited to 'channels.h')
-rw-r--r-- | channels.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/channels.h b/channels.h index bf70a8f21..6739b2214 100644 --- a/channels.h +++ b/channels.h | |||
@@ -32,7 +32,7 @@ | |||
32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
34 | */ | 34 | */ |
35 | /* RCSID("$OpenBSD: channels.h,v 1.31 2001/04/13 22:46:53 beck Exp $"); */ | 35 | /* RCSID("$OpenBSD: channels.h,v 1.32 2001/05/04 23:47:33 markus Exp $"); */ |
36 | 36 | ||
37 | #ifndef CHANNELS_H | 37 | #ifndef CHANNELS_H |
38 | #define CHANNELS_H | 38 | #define CHANNELS_H |
@@ -40,7 +40,6 @@ | |||
40 | #include "buffer.h" | 40 | #include "buffer.h" |
41 | 41 | ||
42 | /* Definitions for channel types. */ | 42 | /* Definitions for channel types. */ |
43 | #define SSH_CHANNEL_FREE 0 /* This channel is free (unused). */ | ||
44 | #define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */ | 43 | #define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */ |
45 | #define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */ | 44 | #define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */ |
46 | #define SSH_CHANNEL_OPENING 3 /* waiting for confirmation */ | 45 | #define SSH_CHANNEL_OPENING 3 /* waiting for confirmation */ |
@@ -56,8 +55,10 @@ | |||
56 | #define SSH_CHANNEL_DYNAMIC 13 | 55 | #define SSH_CHANNEL_DYNAMIC 13 |
57 | #define SSH_CHANNEL_MAX_TYPE 14 | 56 | #define SSH_CHANNEL_MAX_TYPE 14 |
58 | 57 | ||
58 | #define SSH_CHANNEL_PATH_LEN 30 | ||
59 | |||
59 | /* | 60 | /* |
60 | * Data structure for channel data. This is iniailized in channel_allocate | 61 | * Data structure for channel data. This is initialized in channel_new |
61 | * and cleared in channel_free. | 62 | * and cleared in channel_free. |
62 | */ | 63 | */ |
63 | struct Channel; | 64 | struct Channel; |
@@ -84,8 +85,8 @@ struct Channel { | |||
84 | Buffer output; /* data received over encrypted connection for | 85 | Buffer output; /* data received over encrypted connection for |
85 | * send on socket */ | 86 | * send on socket */ |
86 | Buffer extended; | 87 | Buffer extended; |
87 | char path[200]; /* path for unix domain sockets, or host name | 88 | char path[SSH_CHANNEL_PATH_LEN]; |
88 | * for forwards */ | 89 | /* path for unix domain sockets, or host name for forwards */ |
89 | int listening_port; /* port being listened for forwards */ | 90 | int listening_port; /* port being listened for forwards */ |
90 | int host_port; /* remote port to connect for forwards */ | 91 | int host_port; /* remote port to connect for forwards */ |
91 | char *remote_name; /* remote hostname */ | 92 | char *remote_name; /* remote hostname */ |
@@ -132,10 +133,6 @@ void channel_register_filter(int id, channel_filter_fn *fn); | |||
132 | void channel_cancel_cleanup(int id); | 133 | void channel_cancel_cleanup(int id); |
133 | Channel *channel_lookup(int id); | 134 | Channel *channel_lookup(int id); |
134 | 135 | ||
135 | int | ||
136 | channel_new(char *ctype, int type, int rfd, int wfd, int efd, | ||
137 | int window, int maxpack, int extended_usage, char *remote_name, | ||
138 | int nonblock); | ||
139 | void | 136 | void |
140 | channel_set_fds(int id, int rfd, int wfd, int efd, | 137 | channel_set_fds(int id, int rfd, int wfd, int efd, |
141 | int extusage, int nonblock); | 138 | int extusage, int nonblock); |
@@ -162,10 +159,13 @@ void channel_set_options(int hostname_in_open); | |||
162 | * must have been allocated with xmalloc; this will free it when the channel | 159 | * must have been allocated with xmalloc; this will free it when the channel |
163 | * is freed. | 160 | * is freed. |
164 | */ | 161 | */ |
165 | int channel_allocate(int type, int sock, char *remote_name); | 162 | Channel * |
163 | channel_new(char *ctype, int type, int rfd, int wfd, int efd, | ||
164 | int window, int maxpack, int extended_usage, char *remote_name, | ||
165 | int nonblock); | ||
166 | 166 | ||
167 | /* Free the channel and close its socket. */ | 167 | /* Free the channel and close its socket. */ |
168 | void channel_free(int channel); | 168 | void channel_free(Channel *c); |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * Allocate/update select bitmasks and add any bits relevant to channels in | 171 | * Allocate/update select bitmasks and add any bits relevant to channels in |