]>
Commit | Line | Data |
---|---|---|
8efc0c15 | 1 | /* RCSID("$Id$"); */ |
2 | ||
3 | #ifndef NCHAN_H | |
4 | #define NCHAN_H | |
5 | ||
6 | /* | |
7 | * SSH Protocol 1.5 aka New Channel Protocol | |
8 | * Thanks to Martina, Axel and everyone who left Erlangen, leaving me bored. | |
9 | * Written by Markus Friedl in October 1999 | |
5260325f | 10 | * |
8efc0c15 | 11 | * Protocol versions 1.3 and 1.5 differ in the handshake protocol used for the |
12 | * tear down of channels: | |
5260325f | 13 | * |
8efc0c15 | 14 | * 1.3: strict request-ack-protocol: |
15 | * CLOSE -> | |
16 | * <- CLOSE_CONFIRM | |
5260325f | 17 | * |
8efc0c15 | 18 | * 1.5: uses variations of: |
19 | * IEOF -> | |
20 | * <- OCLOSE | |
21 | * <- IEOF | |
22 | * OCLOSE -> | |
23 | * i.e. both sides have to close the channel | |
5260325f | 24 | * |
8efc0c15 | 25 | * See the debugging output from 'ssh -v' and 'sshd -d' of |
26 | * ssh-1.2.27 as an example. | |
5260325f | 27 | * |
8efc0c15 | 28 | */ |
29 | ||
30 | /* ssh-proto-1.5 overloads prot-1.3-message-types */ | |
31 | #define SSH_MSG_CHANNEL_INPUT_EOF SSH_MSG_CHANNEL_CLOSE | |
32 | #define SSH_MSG_CHANNEL_OUTPUT_CLOSE SSH_MSG_CHANNEL_CLOSE_CONFIRMATION | |
33 | ||
34 | /* possible input states */ | |
35 | #define CHAN_INPUT_OPEN 0x01 | |
36 | #define CHAN_INPUT_WAIT_DRAIN 0x02 | |
37 | #define CHAN_INPUT_WAIT_OCLOSE 0x04 | |
38 | #define CHAN_INPUT_CLOSED 0x08 | |
39 | ||
40 | /* possible output states */ | |
41 | #define CHAN_OUTPUT_OPEN 0x10 | |
42 | #define CHAN_OUTPUT_WAIT_DRAIN 0x20 | |
43 | #define CHAN_OUTPUT_WAIT_IEOF 0x40 | |
44 | #define CHAN_OUTPUT_CLOSED 0x80 | |
45 | ||
46 | /* EVENTS for the input state */ | |
5260325f | 47 | void chan_rcvd_oclose(Channel * c); |
48 | void chan_read_failed(Channel * c); | |
49 | void chan_ibuf_empty(Channel * c); | |
8efc0c15 | 50 | |
51 | /* EVENTS for the output state */ | |
5260325f | 52 | void chan_rcvd_ieof(Channel * c); |
53 | void chan_write_failed(Channel * c); | |
54 | void chan_obuf_empty(Channel * c); | |
8efc0c15 | 55 | |
5260325f | 56 | void chan_init_iostates(Channel * c); |
8efc0c15 | 57 | #endif |