summaryrefslogtreecommitdiff
path: root/channels.h
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-05-05 04:09:47 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-05-05 04:09:47 +0000
commit99c73b377a45d3e008e73cca9073dc006e1cfaae (patch)
treeb2b33909e71916ba176521d28663d90fc8b40fc4 /channels.h
parentc8cb8c0405db1f83bd8f97224f69db6a828cc94f (diff)
- markus@cvs.openbsd.org 2001/05/04 23:47:34
[channels.c channels.h clientloop.c nchan.c nchan.h serverloop.c ssh.c] move to Channel **channels (instead of Channel *channels), fixes realloc problems. channel_new now returns a Channel *, favour Channel * over channel id. remove old channel_allocate interface.
Diffstat (limited to 'channels.h')
-rw-r--r--channels.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/channels.h b/channels.h
index bf70a8f2..6739b221 100644
--- a/channels.h
+++ b/channels.h
@@ -32,7 +32,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* RCSID("$OpenBSD: channels.h,v 1.31 2001/04/13 22:46:53 beck Exp $"); */
+/* RCSID("$OpenBSD: channels.h,v 1.32 2001/05/04 23:47:33 markus Exp $"); */
#ifndef CHANNELS_H
#define CHANNELS_H
@@ -40,7 +40,6 @@
#include "buffer.h"
/* Definitions for channel types. */
-#define SSH_CHANNEL_FREE 0 /* This channel is free (unused). */
#define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */
#define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */
#define SSH_CHANNEL_OPENING 3 /* waiting for confirmation */
@@ -56,8 +55,10 @@
#define SSH_CHANNEL_DYNAMIC 13
#define SSH_CHANNEL_MAX_TYPE 14
+#define SSH_CHANNEL_PATH_LEN 30
+
/*
- * Data structure for channel data. This is iniailized in channel_allocate
+ * Data structure for channel data. This is initialized in channel_new
* and cleared in channel_free.
*/
struct Channel;
@@ -84,8 +85,8 @@ struct Channel {
Buffer output; /* data received over encrypted connection for
* send on socket */
Buffer extended;
- char path[200]; /* path for unix domain sockets, or host name
- * for forwards */
+ char path[SSH_CHANNEL_PATH_LEN];
+ /* path for unix domain sockets, or host name for forwards */
int listening_port; /* port being listened for forwards */
int host_port; /* remote port to connect for forwards */
char *remote_name; /* remote hostname */
@@ -132,10 +133,6 @@ void channel_register_filter(int id, channel_filter_fn *fn);
void channel_cancel_cleanup(int id);
Channel *channel_lookup(int id);
-int
-channel_new(char *ctype, int type, int rfd, int wfd, int efd,
- int window, int maxpack, int extended_usage, char *remote_name,
- int nonblock);
void
channel_set_fds(int id, int rfd, int wfd, int efd,
int extusage, int nonblock);
@@ -162,10 +159,13 @@ void channel_set_options(int hostname_in_open);
* must have been allocated with xmalloc; this will free it when the channel
* is freed.
*/
-int channel_allocate(int type, int sock, char *remote_name);
+Channel *
+channel_new(char *ctype, int type, int rfd, int wfd, int efd,
+ int window, int maxpack, int extended_usage, char *remote_name,
+ int nonblock);
/* Free the channel and close its socket. */
-void channel_free(int channel);
+void channel_free(Channel *c);
/*
* Allocate/update select bitmasks and add any bits relevant to channels in