/*
*
* channels.c
*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
*
* Created: Fri Mar 24 16:35:24 1995 ylo
*
* This file contains functions for generic socket connection forwarding.
* There is also code for initiating connection forwarding for X11 connections,
* arbitrary tcp/ip connections, and the authentication agent connection.
*
*/
#include "includes.h"
RCSID("$Id: channels.c,v 1.7 1999/11/24 13:26:22 damien Exp $");
#include "ssh.h"
#include "packet.h"
#include "xmalloc.h"
#include "buffer.h"
#include "authfd.h"
#include "uidswap.h"
#include "readconf.h"
#include "servconf.h"
#include "channels.h"
#include "nchan.h"
#include "compat.h"
/* Maximum number of fake X11 displays to try. */
#define MAX_DISPLAYS 1000
/* Max len of agent socket */
#define MAX_SOCKET_NAME 100
/* Pointer to an array containing all allocated channels. The array is
dynamically extended as needed. */
static Channel *channels = NULL;
/* Size of the channel array. All slots of the array must always be
initialized (at least the type field); unused slots are marked with
type SSH_CHANNEL_FREE. */
static int channels_alloc = 0;
/* Maximum file descriptor value used in any of the channels. This is updated
in channel_allocate. */
static int channel_max_fd_value = 0;<