Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 1 | /* RCSID("$Id: channels.h,v 1.4 1999/11/25 00:54:58 damien Exp $"); */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 2 | |
| 3 | #ifndef CHANNELS_H |
| 4 | #define CHANNELS_H |
| 5 | |
| 6 | /* Definitions for channel types. */ |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 7 | #define SSH_CHANNEL_FREE 0 /* This channel is free (unused). */ |
| 8 | #define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */ |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 9 | #define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */ |
| 10 | #define SSH_CHANNEL_OPENING 3 /* waiting for confirmation */ |
| 11 | #define SSH_CHANNEL_OPEN 4 /* normal open two-way channel */ |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 12 | #define SSH_CHANNEL_CLOSED 5 /* waiting for close confirmation */ |
| 13 | /* SSH_CHANNEL_AUTH_FD 6 authentication fd */ |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 14 | #define SSH_CHANNEL_AUTH_SOCKET 7 /* authentication socket */ |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 15 | /* SSH_CHANNEL_AUTH_SOCKET_FD 8 connection to auth socket */ |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 16 | #define SSH_CHANNEL_X11_OPEN 9 /* reading first X11 packet */ |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 17 | #define SSH_CHANNEL_INPUT_DRAINING 10 /* sending remaining data to conn */ |
| 18 | #define SSH_CHANNEL_OUTPUT_DRAINING 11 /* sending remaining data to app */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 19 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 20 | /* |
| 21 | * Data structure for channel data. This is iniailized in channel_allocate |
| 22 | * and cleared in channel_free. |
| 23 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 24 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 25 | typedef struct Channel { |
| 26 | int type; /* channel type/state */ |
| 27 | int self; /* my own channel identifier */ |
| 28 | int remote_id; /* channel identifier for remote peer */ |
| 29 | /* peer can be reached over encrypted connection, via packet-sent */ |
| 30 | int istate; /* input from channel (state of receive half) */ |
| 31 | int ostate; /* output to channel (state of transmit half) */ |
| 32 | int sock; /* data socket, linked to this channel */ |
| 33 | Buffer input; /* data read from socket, to be sent over |
| 34 | * encrypted connection */ |
| 35 | Buffer output; /* data received over encrypted connection for |
| 36 | * send on socket */ |
| 37 | char path[200]; /* path for unix domain sockets, or host name |
| 38 | * for forwards */ |
| 39 | int listening_port; /* port being listened for forwards */ |
| 40 | int host_port; /* remote port to connect for forwards */ |
| 41 | char *remote_name; /* remote hostname */ |
| 42 | } Channel; |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 43 | #endif |