channels.h revision 57429
1139969Simp/* RCSID("$Id: channels.h,v 1.6 1999/11/24 19:53:45 markus Exp $"); */
274465Srwatson
374465Srwatson#ifndef CHANNELS_H
474465Srwatson#define CHANNELS_H
574465Srwatson
674465Srwatson/* Definitions for channel types. */
774465Srwatson#define SSH_CHANNEL_FREE		0	/* This channel is free (unused). */
874465Srwatson#define SSH_CHANNEL_X11_LISTENER	1	/* Listening for inet X11 conn. */
974465Srwatson#define SSH_CHANNEL_PORT_LISTENER	2	/* Listening on a port. */
1074465Srwatson#define SSH_CHANNEL_OPENING		3	/* waiting for confirmation */
1174465Srwatson#define SSH_CHANNEL_OPEN		4	/* normal open two-way channel */
1274465Srwatson#define SSH_CHANNEL_CLOSED		5	/* waiting for close confirmation */
1374465Srwatson/*	SSH_CHANNEL_AUTH_FD		6    	   authentication fd */
1474465Srwatson#define SSH_CHANNEL_AUTH_SOCKET		7	/* authentication socket */
1574465Srwatson/*	SSH_CHANNEL_AUTH_SOCKET_FD	8    	   connection to auth socket */
1674465Srwatson#define SSH_CHANNEL_X11_OPEN		9	/* reading first X11 packet */
17204819Sjoel#define SSH_CHANNEL_INPUT_DRAINING	10	/* sending remaining data to conn */
18204819Sjoel#define SSH_CHANNEL_OUTPUT_DRAINING	11	/* sending remaining data to app */
19204819Sjoel
20204819Sjoel/*
21204819Sjoel * Data structure for channel data.  This is iniailized in channel_allocate
22204819Sjoel * and cleared in channel_free.
23204819Sjoel */
24204819Sjoel
2574465Srwatsontypedef struct Channel {
2674465Srwatson	int     type;		/* channel type/state */
2799110Sobrien	int     self;		/* my own channel identifier */
2899110Sobrien	int     remote_id;	/* channel identifier for remote peer */
2999110Sobrien	/* peer can be reached over encrypted connection, via packet-sent */
3074465Srwatson	int     istate;		/* input from channel (state of receive half) */
3174465Srwatson	int     ostate;		/* output to channel  (state of transmit half) */
3274465Srwatson	int     sock;		/* data socket, linked to this channel */
3374465Srwatson	Buffer  input;		/* data read from socket, to be sent over
3474465Srwatson				 * encrypted connection */
3574465Srwatson	Buffer  output;		/* data received over encrypted connection for
3674465Srwatson				 * send on socket */
3774465Srwatson	char    path[200];	/* path for unix domain sockets, or host name
3874465Srwatson				 * for forwards */
3974465Srwatson	int     listening_port;	/* port being listened for forwards */
4087254Sjedgar	int     host_port;	/* remote port to connect for forwards */
4187254Sjedgar	char   *remote_name;	/* remote hostname */
4287254Sjedgar}       Channel;
4374465Srwatson#endif
44196936Strasz