- 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.
diff --git a/channels.h b/channels.h
index bf70a8f..6739b22 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 @@
 	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_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 @@
  * 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